endianness(3scm) Scheme Programmer's Manual endianness(3scm)

endianness - quote an endianness symbol

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

(endianness endianness-symbol)

The endianness syntax quotes the endianness-symbol, while ensuring that it is one of the supported endiannesses in the implementation.

An implementation must support at least the symbols big and little, but may support other endianness symbols.

Larcency Scheme
Using this syntax causes a deprecation warning to be printed.

This syntax evaluates to one of the supported endianness symbols.

(endianness little)
          => little
(endianness big)
          => big

This is used as an argument to bytevector procedures.

The native endianness is not included as an option, like it was in SRFI-74. It would have unnecessarily caused the expansion of a program to depend on the machine on which it's expanded.

It is impossible to tell if a new endianness will become popular in the future, so extensions are allowed.

This syntax works the same everywhere that it's supported (but see Implementation Notes above).

This syntax can raise exceptions during expansion with the following condition types:
&syntax (R6RS)
The wrong number of operands was given or the operand was not a supported endianness symbol.

native-endianness(3scm), bytevector-u16-ref(3scm)

R6RS

This syntax is new for R6RS and first appeared in SRFI-74.

There have been mixed-endianness machines, such as the PDP-11, which do not fit as either big or little.

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

2021-03-06