Jump to content

Host introspection: Difference between revisions

Scala added
m (→‎{{header|Objective-C}}: Remove nonexistent template)
(Scala added)
Line 774:
 
Some other implementations of Ruby are different. With [[JRuby]], a Fixnum is always 64 bits, because it is a Java <code>long</code> [http://www.jruby.org/git?p=jruby.git;a=blob;f=src/org/jruby/RubyFixnum.java;h=ba8d076d58d28c30ecd8e378e6e2482486dba22d;hb=HEAD#l91 (1)]. JRuby uses the correct native byte order by calling java.nio.ByteOrder.nativeOrder() [http://www.jruby.org/git?p=jruby.git;a=blob;f=src/org/jruby/platform/Platform.java;h=d84b0b55b1aca381b2101297185d3b7f872c8cfd;hb=HEAD#l110 (2)].
 
=={{header|Scala}}==
[[Category:Scala Implementations]]
{{libheader|Scala}}<lang Scala>import java.nio.ByteOrder
 
object ShowByteOrder extends App {
println(ByteOrder.nativeOrder())
println(s"Word size: ${System.getProperty("sun.arch.data.model")}")
println(s"Endianness: ${System.getProperty("sun.cpu.endian")}")
}</lang>
 
=={{header|Scheme}}==
{{works with|Chicken Scheme}}<lang scheme>(define host-info
<lang scheme>(define host-info
(begin
(display "Endianness: ")
Line 785 ⟶ 794:
(display (if (fixnum? (expt 2 33)) 64 32))
(newline)))</lang>
{{out}}
 
Endianness: little-endian
Output:
Word Size: 32
<pre>
Endianness: little-endian
Word Size: 32
</pre>
 
=={{header|Seed7}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.