11#ifndef __psse_consspaceobject_h
12#define __psse_consspaceobject_h
46#define CONSTV 1397641027
52#define EXCEPTIONTAG "EXEP"
57#define EXCEPTIONTV 1346721861
68#define FREETV 1162170950
75#define FUNCTIONTAG "FUNC"
80#define FUNCTIONTV 1129207110
85#define INTEGERTAG "INTR"
90#define INTEGERTV 1381256777
100#define KEYTV 1465468235
106#define LAMBDATAG "LMDA"
111#define LAMBDATV 1094995276
117#define LOOPTAG "LOOP"
122#define LOOPTV 1347374924
130#define LAZYCONSTAG "LZYC"
138#define LAZYSTRTAG "LZYS"
146#define LAZYWRKRTAG "WRKR"
157#define NILTV 541870414
163#define NLAMBDATAG "NLMD"
168#define NLAMBDATV 1145916494
174#define RATIOTAG "RTIO"
179#define RATIOTV 1330205778
184#define READTAG "READ"
189#define READTV 1145128274
194#define REALTAG "REAL"
199#define REALTV 1279346002
206#define SPECIALTAG "SPFM"
211#define SPECIALTV 1296453715
216#define STRINGTAG "STRG"
221#define STRINGTV 1196577875
226#define SYMBOLTAG "SYMB"
231#define SYMBOLTV 1112365395
236#define TIMETAG "TIME"
241#define TIMETV 1162692948
247#define TRUETAG "TRUE"
252#define TRUETV 1163219540
257#define VECTORPOINTTAG "VECP"
262#define VECTORPOINTTV 1346585942
267#define WRITETAG "WRIT"
272#define WRITETV 1414091351
277#define NIL (struct cons_pointer){ 0, 0}
282#define TRUE (struct cons_pointer){ 0, 1}
287#define MAXREFERENCE 4294967295
292#define tag2uint(tag) ((uint32_t)*tag)
297#define pointer2cell(pointer) ((conspages[pointer.page]->cell[pointer.offset]))
303#define nilp(conspoint) (check_tag(conspoint,NILTV))
308#define consp(conspoint) (check_tag(conspoint,CONSTV))
313#define exceptionp(conspoint) (check_tag(conspoint,EXCEPTIONTV))
318#define functionp(conspoint) (check_tag(conspoint,FUNCTIONTV))
323#define keywordp(conspoint) (check_tag(conspoint,KEYTV))
328#define lambdap(conspoint) (check_tag(conspoint,LAMBDATV))
333#define loopp(conspoint) (check_tag(conspoint,LOOPTV))
338#define specialp(conspoint) (check_tag(conspoint,SPECIALTV))
343#define stringp(conspoint) (check_tag(conspoint,STRINGTV))
348#define symbolp(conspoint) (check_tag(conspoint,SYMBOLTV))
353#define integerp(conspoint) (check_tag(conspoint,INTEGERTV))
358#define ratiop(conspoint) (check_tag(conspoint,RATIOTV))
363#define readp(conspoint) (check_tag(conspoint,READTV))
368#define realp(conspoint) (check_tag(conspoint,REALTV))
374#define numberp(conspoint) (check_tag(conspoint,INTEGERTV)||check_tag(conspoint,RATIOTV)||check_tag(conspoint,REALTV))
380#define sequencep(conspoint) (check_tag(conspoint,CONSTV)||check_tag(conspoint,STRINGTV)||check_tag(conspoint,SYMBOLTV))
385#define vectorpointp(conspoint) (check_tag(conspoint,VECTORPOINTTV))
390#define writep(conspoint) (check_tag(conspoint,WRITETV))
392#define streamp(conspoint) (check_tag(conspoint,READTV)||check_tag(conspoint,WRITETV))
399#define tp(conspoint) (check_tag(conspoint,TRUETV))
404#define timep(conspoint) (check_tag(conspoint,TIMETV))
410#define truep(conspoint) (!check_tag(conspoint,NILTV))
425#define args_in_frame 8
750#define make_symbol(c, t) (make_symbol_or_key( c, t, SYMBOLTV))
752#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.
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 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 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.
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.
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.
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 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)