Down to to compilation errors. Had to reinstate individual size-class headers.

This commit is contained in:
Simon Brooke 2026-03-29 11:07:30 +01:00
parent cae27731b7
commit 00997d3c90
26 changed files with 733 additions and 246 deletions

View file

@ -119,7 +119,7 @@ We don't currently have any other mutable objects, but in future at least lazy o
Secondly, reading from a namespace does not happen in a single clock tick, it takes quite a long time. So it's no good setting a lock bit on the namespace object itself and then immediately assuming that it's now mutable. A reading process could already have started, and be proceeding. Secondly, reading from a namespace does not happen in a single clock tick, it takes quite a long time. So it's no good setting a lock bit on the namespace object itself and then immediately assuming that it's now mutable. A reading process could already have started, and be proceeding.
So what I think is, that we have a single top level function, `(::substrate:search-store key store return-key?)` (which we already sort of have in the 0.0.6 prototype, [here](https://www.journeyman.cc/post-scarcity/doc/html/intern_8c.html#a2189c0ab60e57a70adeb32aca99dbc43)). This searches a store (hashmap, namespace, association list, or hybrid association list) to find a binding for a key, and, having found that binding, then, if there is a namespace on the search path, checks whether the lock on the any namespace on the search path is set, and it it is, aborts the search and tries again; but otherwise returns either the key found (if `return-key?` is non-`nil`), or the value found otherwise. So what I think is, that we have a single top level function, `(::substrate:search-store key store return-key?)` (which we already sort of have in the 0.0.6 prototype, [here](https://www.journeyman.cc/post-scarcity/doc/html/intern_8c.html#a2189c0ab60e57a70adeb32aca99dbc43)). This searches a store (hashmap, namespace, association list, or hybrid association list) to find a binding for a key, and, having found that binding, then, if there is a namespace on the search path, checks whether the lock on the any namespace on the search path is set, and if it is, aborts the search and tries again; but otherwise returns either the key found (if `return-key?` is non-`nil`), or the value found otherwise.
This function implements the user-level Lisp functions `assoc`, `interned`, and `interned?`. It also implements *hashmap-in-function-position* and *keyword-in-function-position*, in so far as both of these are treated as calls to `assoc`. This function implements the user-level Lisp functions `assoc`, `interned`, and `interned?`. It also implements *hashmap-in-function-position* and *keyword-in-function-position*, in so far as both of these are treated as calls to `assoc`.

View file

@ -14,234 +14,234 @@
#include "memory/header.h" #include "memory/header.h"
#include "memory/pointer.h" #include "memory/pointer.h"
#include "payloads/cons.h" // #include "payloads/cons.h"
#include "payloads/exception.h" // #include "payloads/exception.h"
#include "payloads/free.h" // #include "payloads/free.h"
#include "payloads/function.h" // #include "payloads/function.h"
#include "payloads/hashtable.h" // #include "payloads/hashtable.h"
#include "payloads/integer.h" // #include "payloads/integer.h"
#include "payloads/keyword.h" // #include "payloads/keyword.h"
#include "payloads/lambda.h" // #include "payloads/lambda.h"
#include "payloads/mutex.h" // #include "payloads/mutex.h"
#include "payloads/namespace.h" // #include "payloads/namespace.h"
#include "payloads/nlambda.h" // #include "payloads/nlambda.h"
#include "payloads/read_stream.h" // #include "payloads/read_stream.h"
#include "payloads/special.h" // #include "payloads/special.h"
#include "payloads/stack.h" // #include "payloads/stack.h"
#include "payloads/string.h" // #include "payloads/string.h"
#include "payloads/symbol.h" // #include "payloads/symbol.h"
#include "payloads/time.h" // #include "payloads/time.h"
#include "payloads/vector_pointer.h" // #include "payloads/vector_pointer.h"
#include "payloads/write_stream.h" // #include "payloads/write_stream.h"
/** // /**
* @brief A paged space object of size class 2, four words total, two words // * @brief A paged space object of size class 2, four words total, two words
* payload. // * payload.
* // *
*/ // */
struct pso2 { // struct pso2 {
struct pso_header header; // struct pso_header header;
union { // union {
char bytes[16]; // char bytes[16];
uint64_t words[2]; // uint64_t words[2];
struct cons_payload cons; // struct cons_payload cons;
struct free_payload free; // struct free_payload free;
struct function_payload function; // struct function_payload function;
struct integer_payload integer; // struct integer_payload integer;
struct lambda_payload lambda; // struct lambda_payload lambda;
struct special_payload special; // struct special_payload special;
struct stream_payload stream; // struct stream_payload stream;
struct time_payload time; // struct time_payload time;
struct vectorp_payload vectorp; // struct vectorp_payload vectorp;
} payload; // } payload;
}; // };
/** // /**
* @brief A paged space object of size class 3, 8 words total, 6 words // * @brief A paged space object of size class 3, 8 words total, 6 words
* payload. // * payload.
* // *
*/ // */
struct pso3 { // struct pso3 {
struct pso_header header; // struct pso_header header;
union { // union {
char bytes[48]; // char bytes[48];
uint64_t words[6]; // uint64_t words[6];
struct exception_payload exception; // struct exception_payload exception;
struct free_payload free; // struct free_payload free;
struct mutex_payload mutex; // struct mutex_payload mutex;
} payload; // } payload;
}; // };
/** // /**
* @brief A paged space object of size class 4, 16 words total, 14 words // * @brief A paged space object of size class 4, 16 words total, 14 words
* payload. // * payload.
* // *
*/ // */
struct pso4 { // struct pso4 {
struct pso_header header; // struct pso_header header;
union { // union {
char bytes[112]; // char bytes[112];
uint64_t words[14]; // uint64_t words[14];
struct free_payload free; // struct free_payload free;
struct stack_frame_payload stack_frame; // struct stack_frame_payload stack_frame;
} payload; // } payload;
}; // };
/** // /**
* @brief A paged space object of size class 5, 32 words total, 30 words // * @brief A paged space object of size class 5, 32 words total, 30 words
* payload. // * payload.
* // *
*/ // */
struct pso5 { // struct pso5 {
struct pso_header header; // struct pso_header header;
union { // union {
char bytes[240]; // char bytes[240];
uint64_t words[30]; // uint64_t words[30];
struct free_payload free; // struct free_payload free;
} payload; // } payload;
}; // };
/** // /**
* @brief A paged space object of size class 6, 64 words total, 62 words // * @brief A paged space object of size class 6, 64 words total, 62 words
* payload. // * payload.
* // *
*/ // */
struct pso6 { // struct pso6 {
struct pso_header header; // struct pso_header header;
union { // union {
char bytes[496]; // char bytes[496];
uint64_t words[62]; // uint64_t words[62];
struct free_payload free; // struct free_payload free;
struct hashtable_payload hashtable; // struct hashtable_payload hashtable;
struct namespace_payload namespace; // struct namespace_payload namespace;
} payload; // } payload;
}; // };
/** // /**
* @brief A paged space object of size class 7, 128 words total, 126 words // * @brief A paged space object of size class 7, 128 words total, 126 words
* payload. // * payload.
* // *
*/ // */
struct pso7 { // struct pso7 {
struct pso_header header; // struct pso_header header;
union { // union {
char bytes[1008]; // char bytes[1008];
uint64_t words[126]; // uint64_t words[126];
struct free_payload free; // struct free_payload free;
} payload; // } payload;
}; // };
/** // /**
* @brief A paged space object of size class 8, 256 words total, 254 words // * @brief A paged space object of size class 8, 256 words total, 254 words
* payload. // * payload.
* // *
*/ // */
struct pso8 { // struct pso8 {
struct pso_header header; // struct pso_header header;
union { // union {
char bytes[2032]; // char bytes[2032];
uint64_t words[254]; // uint64_t words[254];
struct free_payload free; // struct free_payload free;
} payload; // } payload;
}; // };
/** // /**
* @brief A paged space object of size class 9, 512 words total, 510 words // * @brief A paged space object of size class 9, 512 words total, 510 words
* payload. // * payload.
* // *
*/ // */
struct pso9 { // struct pso9 {
struct pso_header header; // struct pso_header header;
union { // union {
char bytes[4080]; // char bytes[4080];
uint64_t words[510]; // uint64_t words[510];
struct free_payload free; // struct free_payload free;
} payload; // } payload;
}; // };
/** // /**
* @brief A paged space object of size class a, 1024 words total, 1022 words // * @brief A paged space object of size class a, 1024 words total, 1022 words
* payload. // * payload.
* // *
*/ // */
struct psoa { // struct psoa {
struct pso_header header; // struct pso_header header;
union { // union {
char bytes[8176]; // char bytes[8176];
uint64_t words[1022]; // uint64_t words[1022];
struct free_payload free; // struct free_payload free;
} payload; // } payload;
}; // };
/** // /**
* @brief A paged space object of size class b, 2048 words total, 2046 words // * @brief A paged space object of size class b, 2048 words total, 2046 words
* payload. // * payload.
* // *
*/ // */
struct psob { // struct psob {
struct pso_header header; // struct pso_header header;
union { // union {
char bytes[16368]; // char bytes[16368];
uint64_t words[2046]; // uint64_t words[2046];
struct free_payload free; // struct free_payload free;
} payload; // } payload;
}; // };
/** // /**
* @brief A paged space object of size class c, 4096 words total, 4094 words // * @brief A paged space object of size class c, 4096 words total, 4094 words
* payload. // * payload.
* // *
*/ // */
struct psoc { // struct psoc {
struct pso_header header; // struct pso_header header;
union { // union {
char bytes[32752]; // char bytes[32752];
uint64_t words[4094]; // uint64_t words[4094];
struct free_payload free; // struct free_payload free;
} payload; // } payload;
}; // };
/** // /**
* @brief A paged space object of size class d, 8192 words total, 8190 words // * @brief A paged space object of size class d, 8192 words total, 8190 words
* payload. // * payload.
* // *
*/ // */
struct psod { // struct psod {
struct pso_header header; // struct pso_header header;
union { // union {
char bytes[65520]; // char bytes[65520];
uint64_t words[8190]; // uint64_t words[8190];
struct free_payload free; // struct free_payload free;
} payload; // } payload;
}; // };
/** // /**
* @brief A paged space object of size class e, 16384 words total, 16382 words // * @brief A paged space object of size class e, 16384 words total, 16382 words
* payload. // * payload.
* // *
*/ // */
struct psoe { // struct psoe {
struct pso_header header; // struct pso_header header;
union { // union {
char bytes[131056]; // char bytes[131056];
uint64_t words[16382]; // uint64_t words[16382];
struct free_payload free; // struct free_payload free;
} payload; // } payload;
}; // };
/** // /**
* @brief A paged space object of size class f, 32768 words total, 32766 words // * @brief A paged space object of size class f, 32768 words total, 32766 words
* payload. // * payload.
* // *
*/ // */
struct psof { // struct psof {
struct pso_header header; // struct pso_header header;
union { // union {
char bytes[262128]; // char bytes[262128];
uint64_t words[32766]; // uint64_t words[32766];
struct free_payload free; // struct free_payload free;
} payload; // } payload;
}; // };
struct pso_pointer allocate( char* tag, uint8_t size_class); struct pso_pointer allocate( char* tag, uint8_t size_class);

53
src/c/memory/pso2.h Normal file
View file

@ -0,0 +1,53 @@
/**
* memory/pso2.h
*
* Paged space object of size class 2, four words total, two words payload.
*
* (c) 2026 Simon Brooke <simon@journeyman.cc>
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#ifndef __psse_memory_pso2_h
#define __psse_memory_pso2_h
#include <stdint.h>
#include "memory/header.h"
#include "payloads/cons.h"
#include "payloads/free.h"
#include "payloads/function.h"
#include "payloads/integer.h"
#include "payloads/keyword.h"
#include "payloads/lambda.h"
#include "payloads/nlambda.h"
#include "payloads/read_stream.h"
#include "payloads/special.h"
#include "payloads/string.h"
#include "payloads/symbol.h"
#include "payloads/time.h"
#include "payloads/vector_pointer.h"
#include "payloads/write_stream.h"
/**
* @brief A paged space object of size class 2, four words total, two words
* payload.
*
*/
struct pso2 {
struct pso_header header;
union {
char bytes[16];
uint64_t words[2];
struct cons_payload cons;
struct free_payload free;
struct function_payload function;
struct integer_payload integer;
struct lambda_payload lambda;
// struct special_payload special;
struct stream_payload stream;
struct time_payload time;
struct vectorp_payload vectorp;
} payload;
};
#endif

37
src/c/memory/pso3.h Normal file
View file

@ -0,0 +1,37 @@
/**
* memory/pso3.h
*
* Paged space object of size class 3, 8 words total, 6 words payload.
*
* (c) 2026 Simon Brooke <simon@journeyman.cc>
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#ifndef __psse_memory_pso3_h
#define __psse_memory_pso3_h
#include <stdint.h>
#include "memory/header.h"
#include "payloads/exception.h"
#include "payloads/free.h"
#include "payloads/mutex.h"
/**
* @brief A paged space object of size class 3, 8 words total, 6 words
* payload.
*
*/
struct pso3 {
struct pso_header header;
union {
char bytes[48];
uint64_t words[6];
struct exception_payload exception;
struct free_payload free;
struct mutex_payload mutex;
} payload;
};
#endif

34
src/c/memory/pso4.h Normal file
View file

@ -0,0 +1,34 @@
/**
* memory/pso4.h
*
* Paged space object of size class 4, 16 words total, 14 words payload.
*
* (c) 2026 Simon Brooke <simon@journeyman.cc>
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#ifndef __psse_memory_pso4_h
#define __psse_memory_pso4_h
#include <stdint.h>
#include "memory/header.h"
#include "payloads/free.h"
#include "payloads/stack.h"
/**
* @brief A paged space object of size class 4, 16 words total, 14 words
* payload.
*
*/
struct pso4 {
struct pso_header header;
union {
char bytes[112];
uint64_t words[14];
struct free_payload free;
struct stack_frame_payload stack_frame;
} payload;
};
#endif

32
src/c/memory/pso5.h Normal file
View file

@ -0,0 +1,32 @@
/**
* memory/pso5.h
*
* Paged space object of size class 5, 32 words total, 30 words payload.
*
* (c) 2026 Simon Brooke <simon@journeyman.cc>
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#ifndef __psse_memory_pso5_h
#define __psse_memory_pso5_h
#include <stdint.h>
#include "memory/header.h"
#include "payloads/free.h"
/**
* @brief A paged space object of size class 5, 32 words total, 30 words
* payload.
*
*/
struct pso5 {
struct pso_header header;
union {
char bytes[240];
uint64_t words[30];
struct free_payload free;
} payload;
};
#endif

32
src/c/memory/pso6.h Normal file
View file

@ -0,0 +1,32 @@
/**
* memory/pso6.h
*
* Paged space object of size class 6, 64 words total, 62 words payload.
*
* (c) 2026 Simon Brooke <simon@journeyman.cc>
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#ifndef __psse_memory_pso6_h
#define __psse_memory_pso6_h
#include <stdint.h>
#include "memory/header.h"
#include "payloads/free.h"
/**
* @brief A paged space object of size class 6, 64 words total, 62 words
* payload.
*
*/
struct pso6 {
struct pso_header header;
union {
char bytes[496];
uint64_t words[62];
struct free_payload free;
} payload;
};
#endif

32
src/c/memory/pso7.h Normal file
View file

@ -0,0 +1,32 @@
/**
* memory/pso7.h
*
* Paged space object of size class 7, 128 words total, 126 words payload.
*
* (c) 2026 Simon Brooke <simon@journeyman.cc>
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#ifndef __psse_memory_pso7_h
#define __psse_memory_pso7_h
#include <stdint.h>
#include "memory/header.h"
#include "payloads/free.h"
/**
* @brief A paged space object of size class 7, 128 words total, 126 words
* payload.
*
*/
struct pso7 {
struct pso_header header;
union {
char bytes[1008];
uint64_t words[126];
struct free_payload free;
} payload;
};
#endif

32
src/c/memory/pso8.h Normal file
View file

@ -0,0 +1,32 @@
/**
* memory/pso8.h
*
* Paged space object of size class 8, 256 words total, 254 words payload.
*
* (c) 2026 Simon Brooke <simon@journeyman.cc>
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#ifndef __psse_memory_pso8_h
#define __psse_memory_pso8_h
#include <stdint.h>
#include "memory/header.h"
#include "payloads/free.h"
/**
* @brief A paged space object of size class 8, 256 words total, 254 words
* payload.
*
*/
struct pso8 {
struct pso_header header;
union {
char bytes[2032];
uint64_t words[254];
struct free_payload free;
} payload;
};
#endif

32
src/c/memory/pso9.h Normal file
View file

@ -0,0 +1,32 @@
/**
* memory/pso9.h
*
* Paged space object of size class 9, 512 words total, 510 words payload.
*
* (c) 2026 Simon Brooke <simon@journeyman.cc>
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#ifndef __psse_memory_pso9_h
#define __psse_memory_pso9_h
#include <stdint.h>
#include "memory/header.h"
#include "payloads/free.h"
/**
* @brief A paged space object of size class 9, 512 words total, 510 words
* payload.
*
*/
struct pso9 {
struct pso_header header;
union {
char bytes[4080];
uint64_t words[510];
struct free_payload free;
} payload;
};
#endif

32
src/c/memory/psoa.h Normal file
View file

@ -0,0 +1,32 @@
/**
* memory/psoa.h
*
* Paged space object of size class a, 1024 words total, 1022 words payload.
*
* (c) 2026 Simon Brooke <simon@journeyman.cc>
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#ifndef __psse_memory_psoa_h
#define __psse_memory_psoa_h
#include <stdint.h>
#include "memory/header.h"
#include "payloads/free.h"
/**
* @brief A paged space object of size class a, 1024 words total, 1022 words
* payload.
*
*/
struct psoa {
struct pso_header header;
union {
char bytes[8176];
uint64_t words[1022];
struct free_payload free;
} payload;
};
#endif

32
src/c/memory/psob.h Normal file
View file

@ -0,0 +1,32 @@
/**
* memory/psob.h
*
* Paged space object of size class b, 2048 words total, 2046 words payload.
*
* (c) 2026 Simon Brooke <simon@journeyman.cc>
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#ifndef __psse_memory_psob_h
#define __psse_memory_psob_h
#include <stdint.h>
#include "memory/header.h"
#include "payloads/free.h"
/**
* @brief A paged space object of size class b, 2048 words total, 2046 words
* payload.
*
*/
struct psob {
struct pso_header header;
union {
char bytes[16368];
uint64_t words[2046];
struct free_payload free;
} payload;
};
#endif

32
src/c/memory/psoc.h Normal file
View file

@ -0,0 +1,32 @@
/**
* memory/psoc.h
*
* Paged space object of size class c, 4096 words total, 4094 words payload.
*
* (c) 2026 Simon Brooke <simon@journeyman.cc>
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#ifndef __psse_memory_psoc_h
#define __psse_memory_psoc_h
#include <stdint.h>
#include "memory/header.h"
#include "payloads/free.h"
/**
* @brief A paged space object of size class c, 4096 words total, 4094 words
* payload.
*
*/
struct psoc {
struct pso_header header;
union {
char bytes[32752];
uint64_t words[4094];
struct free_payload free;
} payload;
};
#endif

32
src/c/memory/psod.h Normal file
View file

@ -0,0 +1,32 @@
/**
* memory/psod.h
*
* Paged space object of size class d, 8192 words total, 8190 words payload.
*
* (c) 2026 Simon Brooke <simon@journeyman.cc>
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#ifndef __psse_memory_psod_h
#define __psse_memory_psod_h
#include <stdint.h>
#include "memory/header.h"
#include "payloads/free.h"
/**
* @brief A paged space object of size class d, 8192 words total, 8190 words
* payload.
*
*/
struct psod {
struct pso_header header;
union {
char bytes[65520];
uint64_t words[8190];
struct free_payload free;
} payload;
};
#endif

32
src/c/memory/psoe.h Normal file
View file

@ -0,0 +1,32 @@
/**
* memory/psoe.h
*
* Paged space object of size class e, 16384 words total, 16382 words payload.
*
* (c) 2026 Simon Brooke <simon@journeyman.cc>
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#ifndef __psse_memory_psoe_h
#define __psse_memory_psoe_h
#include <stdint.h>
#include "memory/header.h"
#include "payloads/free.h"
/**
* @brief A paged space object of size class e, 16384 words total, 16382 words
* payload.
*
*/
struct psoe {
struct pso_header header;
union {
char bytes[131056];
uint64_t words[16382];
struct free_payload free;
} payload;
};
#endif

32
src/c/memory/psof.h Normal file
View file

@ -0,0 +1,32 @@
/**
* memory/psof.h
*
* Paged space object of size class f, 32768 words total, 32766 words payload.
*
* (c) 2026 Simon Brooke <simon@journeyman.cc>
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#ifndef __psse_memory_psof_h
#define __psse_memory_psof_h
#include <stdint.h>
#include "memory/header.h"
#include "payloads/free.h"
/**
* @brief A paged space object of size class f, 32768 words total, 32766 words
* payload.
*
*/
struct psof {
struct pso_header header;
union {
char bytes[262128];
uint64_t words[32766];
struct free_payload free;
} payload;
};
#endif

View file

@ -11,7 +11,7 @@
#define __psse_payloads_function_h #define __psse_payloads_function_h
#include "memory/pointer.h" #include "memory/pointer.h"
#include "memory/pso.h" #include "memory/pso4.h"
/** /**
* @brief Tag for an ordinary Lisp function - one whose arguments are pre-evaluated. * @brief Tag for an ordinary Lisp function - one whose arguments are pre-evaluated.
@ -41,7 +41,7 @@ struct function_payload {
* a cons pointer (representing its result). * a cons pointer (representing its result).
* \todo check this documentation is current! * \todo check this documentation is current!
*/ */
struct pso_pointer ( *executable ) ( struct pso4 *, struct pso_pointer ( *executable ) ( struct pso4*,
struct pso_pointer, struct pso_pointer,
struct pso_pointer ); struct pso_pointer );
}; };

View file

@ -45,10 +45,10 @@
* i.e. either an assoc list or a further hashtable. * i.e. either an assoc list or a further hashtable.
*/ */
struct hashtable_payload { struct hashtable_payload {
struct cons_pointer hash_fn; /* function for hashing values in this hashtable, or `NIL` to use struct pso_pointer hash_fn; /* function for hashing values in this hashtable, or `NIL` to use
the default hashing function */ the default hashing function */
uint32_t n_buckets; /* number of hash buckets */ uint32_t n_buckets; /* number of hash buckets */
struct cons_pointer buckets[]; /* actual hash buckets, which should be `NIL` struct pso_pointer buckets[]; /* actual hash buckets, which should be `NIL`
* or assoc lists or (possibly) further hashtables. */ * or assoc lists or (possibly) further hashtables. */
}; };

View file

@ -48,16 +48,16 @@
* i.e. either an assoc list or a further namespace. * i.e. either an assoc list or a further namespace.
*/ */
struct namespace_payload { struct namespace_payload {
struct cons_pointer hash_fn; /* function for hashing values in this namespace, or struct pso_pointer hash_fn; /* function for hashing values in this namespace, or
* `NIL` to use the default hashing function */ * `NIL` to use the default hashing function */
uint32_t n_buckets; /* number of hash buckets */ uint32_t n_buckets; /* number of hash buckets */
uint32_t unused; /* for word alignment and possible later expansion */ uint32_t unused; /* for word alignment and possible later expansion */
struct cons_pointer write_acl; /* it seems to me that it is likely that the struct pso_pointer write_acl; /* it seems to me that it is likely that the
* principal difference between a hashtable and a * principal difference between a hashtable and a
* namespace is that a hashtable has a write ACL * namespace is that a hashtable has a write ACL
* of `NIL`, meaning not writeable by anyone */ * of `NIL`, meaning not writeable by anyone */
struct cons_pointer mutex; /* the mutex to lock when modifying this namespace.*/ struct pso_pointer mutex; /* the mutex to lock when modifying this namespace.*/
struct cons_pointer buckets[]; /* actual hash buckets, which should be `NIL` struct pso_pointer buckets[]; /* actual hash buckets, which should be `NIL`
* or assoc lists or (possibly) further hashtables. */ * or assoc lists or (possibly) further hashtables. */
}; };

View file

@ -14,6 +14,7 @@
#include <curl/curl.h> #include <curl/curl.h>
#include "io/fopen.h"
#include "memory/pointer.h" #include "memory/pointer.h"
/** /**
@ -31,7 +32,7 @@ struct stream_payload {
/** metadata on the stream (e.g. its file attributes if a file, its HTTP /** metadata on the stream (e.g. its file attributes if a file, its HTTP
* headers if a URL, etc). Expected to be an association, or nil. Not yet * headers if a URL, etc). Expected to be an association, or nil. Not yet
* implemented. */ * implemented. */
struct cons_pointer meta; struct pso_pointer meta;
}; };
#endif #endif

View file

@ -11,6 +11,7 @@
#define __psse_payloads_special_h #define __psse_payloads_special_h
#include "memory/pointer.h" #include "memory/pointer.h"
#include "memory/pso4.h"
/** /**
* A special form - one whose arguments are not pre-evaluated but passed as * A special form - one whose arguments are not pre-evaluated but passed as
@ -20,25 +21,25 @@
#define SPECIALTAG "SFM" #define SPECIALTAG "SFM"
#define SPECIALTV 5064275 #define SPECIALTV 5064275
/** // /**
* @brief Payload of a special form cell. // * @brief Payload of a special form cell.
* // *
* Currently identical to the payload of a function cell. // * Currently identical to the payload of a function cell.
* \see function_payload // * \see function_payload
*/ // */
struct special_payload { // struct special_payload {
/** // /**
* pointer to the source from which the special form was compiled, or NIL // * pointer to the source from which the special form was compiled, or NIL
* if it is a primitive. // * if it is a primitive.
*/ // */
struct pso_pointer meta; // struct pso_pointer meta;
/** pointer to a function which takes a cons pointer (representing // /** pointer to a function which takes a cons pointer (representing
* its argument list) and a cons pointer (representing its environment) and a // * its argument list) and a cons pointer (representing its environment) and a
* stack frame (representing the previous stack frame) as arguments and returns // * stack frame (representing the previous stack frame) as arguments and returns
* a cons pointer (representing its result). */ // * a cons pointer (representing its result). */
struct pso_pointer ( *executable ) ( struct pso4 *, // struct pso_pointer ( *executable ) ( struct pso4*,
struct pso_pointer, // struct pso_pointer,
struct pso_pointer ); // struct pso_pointer );
}; // };
#endif #endif

View file

@ -11,6 +11,9 @@
#include "memory/pso.h" #include "memory/pso.h"
#include "payloads/stack.h" #include "payloads/stack.h"
#define STACKTAG "STK"
#define STACKTV 4936787
/** /**
* @brief The maximum depth of stack before we throw an exception. * @brief The maximum depth of stack before we throw an exception.
* *

View file

@ -13,6 +13,8 @@
#define __psse_payloads_stack_h #define __psse_payloads_stack_h
#include "memory/pointer.h" #include "memory/pointer.h"
#include "memory/pso2.h"
#include "memory/pso4.h"
/* /*
* number of arguments stored in a stack frame * number of arguments stored in a stack frame

View file

@ -10,6 +10,8 @@
#ifndef __psse_payloads_cons_h #ifndef __psse_payloads_cons_h
#define __psse_payloads_cons_h #define __psse_payloads_cons_h
#include <stdint.h>
#include "memory/pointer.h" #include "memory/pointer.h"
/** /**

View file

@ -16,6 +16,7 @@
* A pointer to an object in vector space. * A pointer to an object in vector space.
*/ */
#define VECTORPOINTTAG "VSP" #define VECTORPOINTTAG "VSP"
#define VECTORPOINTTV 5264214
/** /**
* @brief payload of a vector pointer cell. * @brief payload of a vector pointer cell.

View file

@ -10,6 +10,7 @@
#ifndef __psse_payloads_write_stream_h #ifndef __psse_payloads_write_stream_h
#define __psse_payloads_write_stream_h #define __psse_payloads_write_stream_h
#include "io/fopen.h"
#include "memory/pointer.h" #include "memory/pointer.h"
/** /**