native-endianness(3scm)

πŸ“¦ version 0-unstable-2024-02, in nixpkgs unstable

NAME πŸ’–

okay so bestie, this is native-endianness β€” the manual page for native-endianness from the Scheme Programmer's Manual, section 3scm. Its whole job? Return the native endianness. That's it. Iconic. πŸ’…

πŸ“š LIBRARY πŸ“š

These imports, exactly:

(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. Big-brain byte order, no cap. 🧠
  • little β€” Little endian. The less significant bytes come before the more significant bytes. Tiny-first energy. 🐜

πŸŽ€ RETURN VALUES πŸŽ€

Returns a single symbol. That's the whole return, bestie β€” one symbol, no extras. 🫢

🌸 EXAMPLES 🌸

(native-endianness)
          => little

So on that system, the vibe check says little. πŸ¦‹

πŸ’œ APPLICATION USAGE πŸ’œ

This procedure is sometimes used when interfacing with external systems that use the native endianness to pass data. So if some outside system is like β€œhey, here's data in my native byte order,” this is how you ask your Scheme what that order is. 🫢

πŸ”₯ COMPATIBILITY πŸ”₯

  • This procedure exists in R6RS and is absent from R7RS-small. So if you're on R7RS-small, don't come looking for it here, bestie. 😭
  • SRFI-74 has the native endianness as part of the endianness(7scm) syntax.
  • Other endianness values may exist and they are in that case valid arguments to the system's bytevector procedures. So if you see another one, don't panic β€” it's valid there. No cap. πŸ‘‘
  • 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. So like, don't pass the wrong number of args, or it's gonna throw this at you. 😭

πŸ‘€ SEE ALSO πŸ‘€

🌈 STANDARDS 🌈

R6RS. Periodt. πŸ’…

πŸŽ€ AUTHORS πŸŽ€

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


okay bye bestie! πŸ’– this was native-endianness(3scm), dated 2021-03-09 β€” mwah! πŸ’…βœ¨

πŸ“¦ where this page comes from