Scheme Programmer's Manual

NAME

native-endianness - return the native endianness

LIBRARY

(import (rnrs))                     ;R6RS
(import (rnrs bytevectors))         ;R6RS

SYNOPSIS

(native-endianness)

DESCRIPTION

This procedure returns the native endianness of the system as a symbol. The symbol is normally one of these:
big
Big endian. The more significant bytes come before the less significant bytes.
little
Little endian. The less significant bytes come before the more significant bytes.

RETURN VALUES

Returns a single symbol.

EXAMPLES

(native-endianness)
          => little

APPLICATION USAGE

This procedure is sometimes used when interfacing with external systems that use the native endianness to pass data.

COMPATIBILITY

This procedure exists in R6RS and is absent from R7RS-small. SRFI-74 has the native endianness as part of the endianness(7scheme) syntax.

Other endianness values may exist and they are in that case valid arguments to the system's bytevector procedures.

Most systems today are little endian, but big endian hardware also exists. Other endianness variants have died out.

ERRORS

This procedure can raise exceptions with the following condition types:
&assertion (R6RS)
The wrong number of arguments was passed.

SEE ALSO

endianness(7scheme), bytevector-u16-native-ref(3scheme)

STANDARDS

R6RS

AUTHORS

This page is part of the scheme-manpages project. It includes materials from the RnRS documents. More information can be found at

Index

NAME
LIBRARY
SYNOPSIS
DESCRIPTION
RETURN VALUES
EXAMPLES
APPLICATION USAGE
COMPATIBILITY
ERRORS
SEE ALSO
STANDARDS
AUTHORS
Return to Main Contents