A FASL object is a header followed by one or more object fields followed by an end–of–FASL marker. After the end–of–FASL marker the file must be at its EOF.
The header is the string #@IK0
, followed by 1
if fixnum
width is 30 bits, else followed by 2
; the end of fasl
marker is @
.
If the same object is referenced multiple times in the FASL file: it can be included only once and “marked” with a fixnum; such mark is later dereferenced to insert a reference to the object in the loaded code.
A data word is an exact signed integer of 32-bit or 64-bit depending on the word size of the underlying platform.
An object field is a character in ASCII encoding, optionally followed by data representing the serialisation of a Scheme value:
Denotes the empty list.
Denotes #t
.
Denotes #f
.
Denotes the end of file object.
Denotes the unspecified value (void).
A fixnum stored as a big endian word.
An ASCII string of N characters followed by N octets representing the characters in ASCII encoding. The data word N must represent an exact integer in the range of fixnums.
A Unicode string of N characters followed by N 32-bit integers in native order representing the characters as Unicode code points. The data word N must represent an exact integer in the range of fixnums.
A symbol. symbol-name
is a string field.
A gensym. Both pretty-name
and unique-name
are strings.
A character in the ASCII range (<= 255).
A character stored as 32-bit integer representing a Unicode code point.
A pair.
A vector of length N followed by N object fields. The data word N must represent an exact integer in the range of fixnums.
A bytevector of length N followed by N octets. The data word N must represent an exact integer in the range of fixnums.
A struct type descriptor. rtd-name
must be a symbol.
rtd-symbol
must be a symbol. field-count
must be a word
in the fixnum range. The name
object fields must be symbols
representing the field name and there must be field-count
of
them.
A structure instance. field-count
must be a word in the fixnum
range. rtd
must be a struct type descriptor. The field
object fields must be the fields of the structure instance and there
must be field-count
of them.
Ratnum.
IEEE double precision flonum. The bytes are stored: most significant first, least significant last.
Denotes a bignum. N is a signed integer word whose sign is the sign of the bignum and whose modulo is the number of octets representing the bignum.
Complex numbers, both cflonum and compnum.
A short chain of pairs followed by its elements, including the cdr of the last pair; the number N <= 255 is 2 less than the number of elements. As example, the list:
(#\A . (#\B . (#\C . #\D)))
has N = 2, so it is serialised as:
"l" octet(2) #\A #\B #\C #\D
As other example, the standalone pair ‘(#\A . #\B)’ has N = 0, so it is serialised as:
"l" octet(0) #\A #\B
A long chain of pairs followed by its elements, including the cdr of the last pair; the number N > 255 is 2 less than the number of elements. See the format of ‘l’ for details.
eq?
hashtable, first vector keys, second vector values.
eqv?
hashtable, first vector keys, second vector values.
An R6RS record type descriptor.
name
Must be the return value of record-type-name
.
parent
Must be the return value of record-type-parent
.
uid
Must be the return value of record-type-uid
.
sealed?
Must be the return value of record-type-sealed?
.
opaque?
Must be the return value of record-type-opaque?
.
count
Must be a fixnum representing the number of fields.
Each bool + field
sequence must be a boolean representing the
mutability of the record field, followed by symbol representing the name
of the record field.
Denotes code. A serialised code object is represented as follows, after the ‘x’ header:
Procedure. A procedure is represented by the header Q
followed
by the serialisation of a code object, header x
included.
Mark the next object with index I.
Dereference the object marked with index I.
Foreign library identifier. libid
must be a string representing
the foreign shared library identifier: on Unix–like systems it is
prefixed with lib
and suffixed with .so
to compose a
library file name.