This once again does NOT compile. I've done work on macros; they don't work yet..

This commit is contained in:
Simon Brooke 2026-03-30 21:49:08 +01:00
parent e3f922a8bf
commit 2b22780ccf
86 changed files with 279 additions and 153 deletions

View file

@ -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.

View file

@ -13,11 +13,6 @@
#include "memory/pointer.h"
/**
* An ordinary cons cell:
*/
#define CONSTAG "CNS"
#define CONSTV 5459523
/**
* @brief A cons cell.

View file

@ -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 );
}

View file

@ -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

View file

@ -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.
*

View file

@ -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

View file

@ -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:

View file

@ -12,9 +12,6 @@
#include <stdint.h>
#define INTEGERTAG "INT"
#define INTEGERTV 5525065
/**
* @brief An integer .
*

View file

@ -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. */

View file

@ -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.
*

View file

@ -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:

View file

@ -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

View file

@ -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.
*

View file

@ -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.
*/

View file

@ -21,7 +21,5 @@
* provided.
* \see NLAMBDATAG.
*/
#define SPECIALTAG "SFM"
#define SPECIALTV 5064275
#endif

View file

@ -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

View file

@ -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. */

View file

@ -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 );
}

View file

@ -39,6 +39,4 @@ struct vectorp_payload {
void *address;
};
bool vectorpointp( struct pso_pointer p );
#endif

View file

@ -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