This once again does NOT compile. I've done work on macros; they don't work yet..
This commit is contained in:
parent
e3f922a8bf
commit
2b22780ccf
86 changed files with 279 additions and 153 deletions
|
|
@ -13,6 +13,7 @@
|
|||
#include "memory/pointer.h"
|
||||
#include "memory/pso.h"
|
||||
#include "memory/pso2.h"
|
||||
#include "memory/tags.h"
|
||||
#include "payloads/cons.h"
|
||||
|
||||
/**
|
||||
|
|
@ -36,17 +37,6 @@ struct pso_pointer cons( struct pso_pointer car, struct pso_pointer cdr ) {
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief return true if `ptr` indicates a cons cell, else false.
|
||||
*
|
||||
* @param ptr a pointer.
|
||||
* @return true if `ptr` indicates a cons cell.
|
||||
* @return false otherwise
|
||||
*/
|
||||
bool consp( struct pso_pointer ptr ) {
|
||||
// TODO: make it actually work!
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief return the car of this cons cell.
|
||||
|
|
|
|||
|
|
@ -13,11 +13,6 @@
|
|||
|
||||
#include "memory/pointer.h"
|
||||
|
||||
/**
|
||||
* An ordinary cons cell:
|
||||
*/
|
||||
#define CONSTAG "CNS"
|
||||
#define CONSTV 5459523
|
||||
|
||||
/**
|
||||
* @brief A cons cell.
|
||||
|
|
|
|||
|
|
@ -12,10 +12,3 @@
|
|||
#include "memory/pso.h"
|
||||
#include "payloads/exception.h"
|
||||
|
||||
/**
|
||||
* @param p a pointer to an object.
|
||||
* @return true if that object is an exception, else false.
|
||||
*/
|
||||
bool exceptionp( struct pso_pointer p ) {
|
||||
return ( get_tag_value( p ) == EXCEPTIONTV );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,9 +13,6 @@
|
|||
|
||||
#include "memory/pointer.h"
|
||||
|
||||
#define EXCEPTIONTAG "EXP"
|
||||
#define EXCEPTIONTV 5265477
|
||||
|
||||
/**
|
||||
* @brief An exception; required three pointers, so use object of size class 3.
|
||||
*/
|
||||
|
|
@ -28,6 +25,4 @@ struct exception_payload {
|
|||
struct pso_pointer cause;
|
||||
};
|
||||
|
||||
bool exceptionp( struct pso_pointer p );
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -12,12 +12,6 @@
|
|||
|
||||
#include "memory/pointer.h"
|
||||
|
||||
/**
|
||||
* @brief Tag for an unassigned object; may be of any size class.
|
||||
*/
|
||||
#define FREETAG "FRE"
|
||||
#define FREETV 4543046
|
||||
|
||||
/**
|
||||
* @brief An unassigned object, on a freelist; may be of any size class.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -13,14 +13,6 @@
|
|||
#include "memory/pointer.h"
|
||||
#include "memory/pso4.h"
|
||||
|
||||
/**
|
||||
* @brief Tag for an ordinary Lisp function - one whose arguments are pre-evaluated.
|
||||
* \see LAMBDATAG for interpretable functions.
|
||||
* \see SPECIALTAG for functions whose arguments are not pre-evaluated.
|
||||
*/
|
||||
#define FUNCTIONTAG "FUN"
|
||||
#define FUNCTIONTV 5133638
|
||||
|
||||
/**
|
||||
* @brief Payload of a function cell.
|
||||
* `source` points to the source from which the function was compiled, or NIL
|
||||
|
|
|
|||
|
|
@ -32,13 +32,6 @@
|
|||
|
||||
#include "memory/pointer.h"
|
||||
|
||||
/**
|
||||
* @brief Tag for an ordinary Lisp hashtable - one whose contents are immutable.
|
||||
* \see NAMESPACETAG for mutable hashtables.
|
||||
*/
|
||||
#define HASHTABLETAG "HTB"
|
||||
#define HASHTABLETV 4346952
|
||||
|
||||
/**
|
||||
* The payload of a hashtable. The number of buckets is assigned at run-time,
|
||||
* and is stored in n_buckets. Each bucket is something ASSOC can consume:
|
||||
|
|
|
|||
|
|
@ -12,9 +12,6 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#define INTEGERTAG "INT"
|
||||
#define INTEGERTV 5525065
|
||||
|
||||
/**
|
||||
* @brief An integer .
|
||||
*
|
||||
|
|
|
|||
|
|
@ -12,12 +12,6 @@
|
|||
|
||||
#include "memory/pointer.h"
|
||||
|
||||
/**
|
||||
* Tag for a keyword - an interned, self-evaluating string.
|
||||
*/
|
||||
#define KEYTAG "KEY"
|
||||
#define KEYTV 5850443
|
||||
|
||||
/* TODO: for now, Keyword shares a payload with String, but this may change.
|
||||
* Strings are of indefinite length, but keywords are really not, and might
|
||||
* fit into any size class. */
|
||||
|
|
|
|||
|
|
@ -14,14 +14,6 @@
|
|||
|
||||
#include "memory/pointer.h"
|
||||
|
||||
/**
|
||||
* @brief Tag for mutex cell. mutexes are thread-safe locks, required by
|
||||
* mutable objects.
|
||||
* \see FUNCTIONTAG.
|
||||
*/
|
||||
#define MUTEXTAG "MTX"
|
||||
#define MUTEXTV 5788749
|
||||
|
||||
/**
|
||||
* @brief payload for mutex objects.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -35,13 +35,6 @@
|
|||
|
||||
#include "memory/pointer.h"
|
||||
|
||||
/**
|
||||
* @brief Tag for a Lisp namespace - a hashtable whose contents are mutable.
|
||||
* \see HASHTABLETAG for mutable hashtables.
|
||||
*/
|
||||
#define NAMESPACETAG "NSP"
|
||||
#define NAMESPACETV 5264206
|
||||
|
||||
/**
|
||||
* The payload of a namespace. The number of buckets is assigned at run-time,
|
||||
* and is stored in n_buckets. Each bucket is something ASSOC can consume:
|
||||
|
|
|
|||
|
|
@ -12,12 +12,6 @@
|
|||
|
||||
#include "memory/pointer.h"
|
||||
|
||||
/**
|
||||
* An ordinary nlambda cell:
|
||||
*/
|
||||
#define NLAMBDATAG "NLM"
|
||||
#define NLAMBDATV 5065806
|
||||
|
||||
/* nlambda shares a payload with lambda */
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -17,13 +17,6 @@
|
|||
|
||||
#include "memory/pointer.h"
|
||||
|
||||
|
||||
/**
|
||||
* @brief Tag for string of characters, organised as a linked list.
|
||||
*/
|
||||
#define STRINGTAG "STR"
|
||||
#define STRINGTV 5395539
|
||||
|
||||
/**
|
||||
* @brief payload of a string cell.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,12 +17,6 @@
|
|||
#include "io/fopen.h"
|
||||
#include "memory/pointer.h"
|
||||
|
||||
/**
|
||||
* An open read stream.
|
||||
*/
|
||||
#define READTAG "REA"
|
||||
#define READTV 4277586
|
||||
|
||||
/**
|
||||
* payload of a read or write stream cell.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -21,7 +21,5 @@
|
|||
* provided.
|
||||
* \see NLAMBDATAG.
|
||||
*/
|
||||
#define SPECIALTAG "SFM"
|
||||
#define SPECIALTV 5064275
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -13,10 +13,6 @@
|
|||
#define __psse_payloads_stack_h
|
||||
|
||||
#include "memory/pointer.h"
|
||||
// #include "memory/pso4.h"
|
||||
|
||||
#define STACKTAG "STK"
|
||||
#define STACKTV 4936787
|
||||
|
||||
/*
|
||||
* number of arguments stored in a stack frame
|
||||
|
|
|
|||
|
|
@ -12,13 +12,6 @@
|
|||
|
||||
#include "memory/pointer.h"
|
||||
|
||||
|
||||
/**
|
||||
* Tag for a symbol: just like a keyword except not self-evaluating.
|
||||
*/
|
||||
#define SYMBOLTAG "SYM"
|
||||
#define SYMBOLTV 5069139
|
||||
|
||||
/* TODO: for now, Symbol shares a payload with String, but this may change.
|
||||
* Strings are of indefinite length, but symbols are really not, and might
|
||||
* fit into any size class. */
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
/**
|
||||
* payloads/vector_pointer.c
|
||||
*
|
||||
* A pointer to an object in vector space.
|
||||
*
|
||||
* (c) 2026 Simon Brooke <simon@journeyman.cc>
|
||||
* Licensed under GPL version 2.0, or, at your option, any later version.
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "memory/pointer.h"
|
||||
#include "memory/pso.h"
|
||||
#include "payloads/vector_pointer.h"
|
||||
|
||||
bool vectorpointp( struct pso_pointer p ) {
|
||||
return ( get_tag_value( p ) == VECTORPOINTTV );
|
||||
}
|
||||
|
|
@ -39,6 +39,4 @@ struct vectorp_payload {
|
|||
void *address;
|
||||
};
|
||||
|
||||
bool vectorpointp( struct pso_pointer p );
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -10,14 +10,5 @@
|
|||
#ifndef __psse_payloads_write_stream_h
|
||||
#define __psse_payloads_write_stream_h
|
||||
|
||||
#include "io/fopen.h"
|
||||
#include "memory/pointer.h"
|
||||
|
||||
/**
|
||||
* @brief Tag for an open write stream.
|
||||
*/
|
||||
#define WRITETAG "WRT"
|
||||
#define WRITETV 5264214
|
||||
|
||||
/* write stream shares a payload with /see read_streem.h */
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue