Host introspection: Difference between revisions

Content added Content deleted
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
(→‎{{header|Raku}}: Add an alternate)
Line 991: Line 991:
which makes endian detection a little easier:
which makes endian detection a little easier:
<lang perl6>say blob8.new(1,0).read-int16(0) == 1 ?? "little-endian" !! "big-endian"</lang>
<lang perl6>say blob8.new(1,0).read-int16(0) == 1 ?? "little-endian" !! "big-endian"</lang>

In Rakudo 2019.01 the dynamic KERNAL varible was fleshed out with a bunch of accessors, among them:
<lang perl6>say join ', ', $*KERNEL, $*KERNEL.bits, $*KERNEL.arch, $*KERNEL.endian</lang>
{{out}}
<pre>linux, 64, x86_64, LittleEndian</pre>


=={{header|Retro}}==
=={{header|Retro}}==