38 wchar_t c = cell->
payload.string.character;
43 pointer = cell->
payload.string.cdr;
65 bool initial_space ) {
68 switch ( cell->
tag.value ) {
70 if ( initial_space ) {
81 print( output, pointer );
100 print( output, key );
121 fwprintf( stderr, L
"Unrecognised vector-space type '%d'\n",
131 fwprintf( stderr, L
"0" );
133 char str[40] = { 0 };
134 char *s = str +
sizeof( str ) - 1;
139 *--s =
"0123456789"[n % 10];
159 switch ( cell.
tag.value ) {
182 url_fputws( L
"<Anonymous Function: ", output );
188 print( output, to_print );
198 url_fputws( L
"<Anonymous Special Form: ", output );
204 print( output, to_print );
224 buffer = (
char * ) malloc( 24 );
225 memset( buffer, 0, 24 );
227 sprintf( buffer,
"%-.23Lg", cell.
payload.real.value );
228 if ( strchr( buffer,
'.' ) != NULL ) {
229 for (
int i = strlen( buffer ) - 1; buffer[i] ==
'0'; i-- ) {
267 L
"Error: Unrecognised tag value %d (%4.4s)\n",
268 cell.
tag.value, &cell.
tag.bytes[0] );
struct cons_pointer c_cdr(struct cons_pointer arg)
Implementation of cdr in C.
struct cons_pointer c_car(struct cons_pointer arg)
Implementation of car in C.
#define KEYTV
The string KEYW, considered as an unsigned int.
#define SPECIALTV
The string SPFM, considered as an unsigned int.
#define VECTORPOINTTV
The string VECP, considered as an unsigned int.
#define SYMBOLTV
The string SYMB, considered as an unsigned int.
union cons_space_object::@2 tag
union cons_space_object::@3 payload
#define FUNCTIONTV
The string FUNC, considered as an unsigned int.
#define STRINGTV
The string STRG, considered as an unsigned int.
#define TIMETV
The string TIME, considered as an unsigned int.
#define INTEGERTV
The string INTR, considered as an unsigned int.
#define RATIOTV
The string RTIO, considered as an unsigned int.
#define CONSTV
The string CONS, considered as an unsigned int.
#define nilp(conspoint)
true if conspoint points to the special cell NIL, else false (there should only be one of these so it...
#define NLAMBDATV
The string NLMD, considered as an unsigned int.
#define TRUETV
The string TRUE, considered as an unsigned int.
#define symbolp(conspoint)
true if conspoint points to a symbol cell, else false
#define REALTV
The string REAL, considered as an unsigned int.
#define NILTV
The string NIL, considered as an unsigned int.
#define EXCEPTIONTV
The string EXEP, considered as an unsigned int.
#define stringp(conspoint)
true if conspoint points to a string cell, else false
struct cons_pointer c_string_to_lisp_symbol(wchar_t *symbol)
Return a lisp symbol representation of this wide character string.
#define keywordp(conspoint)
true if conspoint points to a keyword, else false
#define LAMBDATV
The string LMDA, considered as an unsigned int.
#define WRITETV
The string WRIT, considered as an unsigned int.
#define READTV
The string READ, considered as an unsigned int.
struct cons_pointer dec_ref(struct cons_pointer pointer)
Decrement the reference count of the object at this cons pointer.
#define pointer2cell(pointer)
given a cons_pointer as argument, return the cell.
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.
#define url_fputwc(wc, f)
#define url_fputws(ws, f)
#define url_fwprintf(f,...)
struct cons_pointer integer_to_string(struct cons_pointer int_pointer, int base)
return a string representation of this integer, which may be a bignum.
struct cons_pointer hashmap_get(struct cons_pointer mapp, struct cons_pointer key)
Get a value from a hashmap.
struct cons_pointer hashmap_keys(struct cons_pointer mapp)
return a flat list of all the keys in the hashmap indicated by map.
void print_string(URL_FILE *output, struct cons_pointer pointer)
print all the characters in the string indicated by pointer onto the stream at this output,...
void print_vso(URL_FILE *output, struct cons_pointer pointer)
void print_list_contents(URL_FILE *output, struct cons_pointer pointer, bool initial_space)
Print a single list cell (cons cell) indicated by pointer to the stream indicated by output.
void print_list(URL_FILE *output, struct cons_pointer pointer)
void print_map(URL_FILE *output, struct cons_pointer map)
void print_string_contents(URL_FILE *output, struct cons_pointer pointer)
print all the characters in the symbol or string indicated by pointer onto this output; if pointer do...
void println(URL_FILE *output)
struct cons_pointer print(URL_FILE *output, struct cons_pointer pointer)
Print the cons-space object indicated by pointer to the stream indicated by output.
void print_128bit(URL_FILE *output, __int128_t n)
stolen from https://stackoverflow.com/questions/11656241/how-to-print-uint128-t-number-using-gcc
struct cons_pointer time_to_string(struct cons_pointer pointer)
This is temporary, for bootstrapping.
void dump_stack_trace(URL_FILE *output, struct cons_pointer pointer)
#define pointer_to_vso(pointer)
given a pointer to a vector space object, return the object.
#define hashmapp(conspoint)
struct vector_space_header header
the header of this object
union vector_space_header::@4 tag
the tag (type) of this vector-space object.
a vector_space_object is just a vector_space_header followed by a lump of bytes; what we deem to be i...