11#ifndef __psse_consspaceobject_h
12#define __psse_consspaceobject_h
46#define CONSTV 1397641027
52#define EXCEPTIONTAG "EXEP"
57#define EXCEPTIONTV 1346721861
104#define FREETV 1162170950
111#define FUNCTIONTAG "FUNC"
116#define FUNCTIONTV 1129207110
121#define INTEGERTAG "INTR"
126#define INTEGERTV 1381256777
136#define KEYTV 1465468235
142#define LAMBDATAG "LMDA"
147#define LAMBDATV 1094995276
153#define LOOPTAG "LOOP"
158#define LOOPTV 1347374924
166#define LAZYCONSTAG "LZYC"
174#define LAZYSTRTAG "LZYS"
182#define LAZYWRKRTAG "WRKR"
193#define NILTV 541870414
199#define NLAMBDATAG "NLMD"
204#define NLAMBDATV 1145916494
210#define RATIOTAG "RTIO"
215#define RATIOTV 1330205778
220#define READTAG "READ"
225#define READTV 1145128274
230#define REALTAG "REAL"
235#define REALTV 1279346002
242#define SPECIALTAG "SPFM"
247#define SPECIALTV 1296453715
252#define STRINGTAG "STRG"
257#define STRINGTV 1196577875
262#define SYMBOLTAG "SYMB"
267#define SYMBOLTV 1112365395
272#define TIMETAG "TIME"
277#define TIMETV 1162692948
283#define TRUETAG "TRUE"
288#define TRUETV 1163219540
293#define VECTORPOINTTAG "VECP"
298#define VECTORPOINTTV 1346585942
303#define WRITETAG "WRIT"
308#define WRITETV 1414091351
313#define NIL (struct cons_pointer){ 0, 0}
318#define TRUE (struct cons_pointer){ 0, 1}
323#define MAXREFERENCE 4294967295
328#define tag2uint(tag) ((uint32_t)*tag)
333#define pointer2cell(pointer) ((conspages[pointer.page]->cell[pointer.offset]))
339#define nilp(conspoint) (check_tag(conspoint,NILTV))
344#define consp(conspoint) (check_tag(conspoint,CONSTV))
349#define exceptionp(conspoint) (check_tag(conspoint,EXCEPTIONTV))
354#define freep(conspoint) (check_tag(conspoint,FREETV))
359#define functionp(conspoint) (check_tag(conspoint,FUNCTIONTV))
364#define keywordp(conspoint) (check_tag(conspoint,KEYTV))
369#define lambdap(conspoint) (check_tag(conspoint,LAMBDATV))
374#define loopp(conspoint) (check_tag(conspoint,LOOPTV))
379#define specialp(conspoint) (check_tag(conspoint,SPECIALTV))
384#define stringp(conspoint) (check_tag(conspoint,STRINGTV))
389#define symbolp(conspoint) (check_tag(conspoint,SYMBOLTV))
394#define integerp(conspoint) (check_tag(conspoint,INTEGERTV))
399#define ratiop(conspoint) (check_tag(conspoint,RATIOTV))
404#define readp(conspoint) (check_tag(conspoint,READTV))
409#define realp(conspoint) (check_tag(conspoint,REALTV))
415#define numberp(conspoint) (check_tag(conspoint,INTEGERTV)||check_tag(conspoint,RATIOTV)||check_tag(conspoint,REALTV))
421#define sequencep(conspoint) (check_tag(conspoint,CONSTV)||check_tag(conspoint,STRINGTV)||check_tag(conspoint,SYMBOLTV))
426#define vectorpointp(conspoint) (check_tag(conspoint,VECTORPOINTTV))
431#define writep(conspoint) (check_tag(conspoint,WRITETV))
433#define streamp(conspoint) (check_tag(conspoint,READTV)||check_tag(conspoint,WRITETV))
440#define tp(conspoint) (check_tag(conspoint,TRUETV))
445#define timep(conspoint) (check_tag(conspoint,TIMETV))
451#define truep(conspoint) (!check_tag(conspoint,NILTV))
466#define args_in_frame 8
798#define make_symbol(c, t) (make_symbol_or_key( c, t, SYMBOLTV))
800#define make_keyword(c, t) (make_symbol_or_key( c, t, KEYTV))
struct cons_pointer divisor
a pointer to an integer representing the divisor.
struct cons_pointer more
list of any further argument bindings.
uint32_t hash
a hash of the string value, computed at store time.
int args
the number of arguments provided.
struct cons_pointer privileged_keyword_primitive
keywords used in documentation: :primitive.
union cons_space_object::@2 tag
union cons_space_object::@3 payload
uint32_t page
the index of the page on which this cell resides
struct cons_pointer make_exception(struct cons_pointer message, struct cons_pointer frame_pointer)
Construct an exception cell.
struct cons_pointer body
the body of the function to be applied to the arguments.
struct cons_pointer make_lambda(struct cons_pointer args, struct cons_pointer body)
Construct a lambda (interpretable source) cell.
struct cons_pointer make_symbol_or_key(wint_t c, struct cons_pointer tail, uint32_t tag)
Construct a symbol or keyword from the character c and this tail.
struct cons_pointer make_special(struct cons_pointer src, struct cons_pointer(*executable)(struct stack_frame *, struct cons_pointer, struct cons_pointer))
struct cons_pointer dividend
a pointer to an integer representing the dividend
struct cons_pointer c_string_to_lisp_keyword(wchar_t *symbol)
Return a lisp keyword representation of this wide character string.
struct cons_pointer c_cdr(struct cons_pointer arg)
Implementation of cdr in C.
struct cons_pointer make_string_like_thing(wint_t c, struct cons_pointer tail, uint32_t tag)
Construct a string from this character (which later will be UTF) and this tail.
struct cons_pointer meta
metadata on the stream (e.g.
URL_FILE * stream
the stream to read from or write to.
struct cons_pointer cdr
Contents of the Decrement Register, naturally.
struct cons_pointer args
the arument list
union vectorp_payload::@1 tag
the tag of the vector-space object.
#define TAGLENGTH
The length of a tag, in bytes.
int c_length(struct cons_pointer arg)
Implementation of length in C.
struct cons_pointer access
cons pointer to the access control list of this cell
struct cons_pointer privileged_keyword_cause
Keywords used when constructing exceptions: :cause.
struct cons_pointer frame
pointer to the (unfreed) stack frame in which the exception was thrown.
struct cons_pointer make_string(wint_t c, struct cons_pointer tail)
Construct a string from the character c and this tail.
struct cons_pointer privileged_keyword_name
keywords used in documentation: :name.
struct cons_pointer previous
the previous frame.
bool check_tag(struct cons_pointer pointer, uint32_t value)
True if the value of the tag on the cell at this pointer is this value, or, if the tag of the cell is...
uint32_t count
the count of the number of references to this cell
uint32_t offset
the index of the cell within the page
struct cons_pointer make_function(struct cons_pointer src, struct cons_pointer(*executable)(struct stack_frame *, struct cons_pointer, struct cons_pointer))
Construct a cell which points to an executable Lisp function.
uint32_t get_tag_value(struct cons_pointer pointer)
given a cons_pointer as argument, return the tag.
struct cons_pointer privileged_keyword_documentation
keywords used in documentation: :documentation.
struct cons_pointer make_write_stream(URL_FILE *output, struct cons_pointer metadata)
Construct a cell which points to a stream open for writing.
struct cons_pointer c_string_to_lisp_string(wchar_t *string)
Return a lisp string representation of this wide character string.
long double value
the value of the number
struct cons_pointer inc_ref(struct cons_pointer pointer)
increment the reference count of the object at this cons pointer.
struct cons_pointer function
the function to be called.
uint32_t padding
unused padding to word-align the address
void * address
the address of the actual vector space object (
struct cons_pointer make_read_stream(URL_FILE *input, struct cons_pointer metadata)
Construct a cell which points to a stream open for reading.
struct cons_pointer payload
The payload: usually a Lisp string but in practice anything printable will do.
struct cons_pointer privileged_keyword_payload
Keywords used when constructing exceptions: :payload.
int64_t value
the value of the payload (i.e.
struct cons_pointer c_string_to_lisp_symbol(wchar_t *symbol)
Return a lisp symbol representation of this wide character string.
struct cons_pointer c_car(struct cons_pointer arg)
Implementation of car in C.
int depth
the depth of the stack below this frame
wint_t character
the actual character stored in this cell
struct cons_pointer c_type(struct cons_pointer pointer)
Get the Lisp type of the single argument.
struct cons_pointer make_nlambda(struct cons_pointer args, struct cons_pointer body)
Construct an nlambda (interpretable source) cell; to a lambda as a special form is to a function.
struct cons_pointer arg[args_in_frame]
first 8 arument bindings.
struct cons_pointer dec_ref(struct cons_pointer pointer)
Decrement the reference count of the object at this cons pointer.
struct cons_pointer privileged_keyword_location
Keywords used when constructing exceptions: :location.
struct cons_pointer car
Contents of the Address Register, naturally.
struct cons_pointer make_cons(struct cons_pointer car, struct cons_pointer cdr)
Construct a cons cell from this pair of pointers.
An indirect pointer to a cons cell.
payload of an integer cell.
payload for lambda and nlambda cells.
payload for a real number cell.
payload of a read or write stream cell.
payload of a string cell.
The payload of a time cell: an unsigned 128 bit value representing micro- seconds since the estimated...
payload of a vector pointer cell.
Payload of a function cell.
struct cons_pointer meta
pointer to metadata (e.g.
struct cons_pointer(* executable)(struct stack_frame *, struct cons_pointer, struct cons_pointer)
pointer to a function which takes a cons pointer (representing its argument list) and a cons pointer ...
Payload of a special form cell.
struct cons_pointer meta
pointer to the source from which the special form was compiled, or NIL if it is a primitive.
struct cons_pointer(* executable)(struct stack_frame *, struct cons_pointer, struct cons_pointer)
pointer to a function which takes a cons pointer (representing its argument list) and a cons pointer ...
#define vectorp(conspoint)