773 B
773 B
representation of Scheme types
the Scheme unitype is encoded as (ref eq) with immediates in (ref i31) and heap objects in $heap-object:
(type $heap-object (sub (struct (field $hash (mut i32)))))
immediates
all immediates are stored in (ref i31) and thus must fit in 31 bits. the most important immediate, the integer, is indicated by a null low bit.
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XX00
||
|\ used by wasm's i31 rep
zero indicates a 30-bit fixnum /
in the upper bits
| type/value | low bits |
|---|---|
| small int | 0 |
false |
01 |
true |
11 |