summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-03-22 18:44:12 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-03-22 18:44:12 -0700
commit24bfded1413e45bb949f6c1ee2b3e8ef34f12329 (patch)
tree2c0ee03aa67f25cde703f6b98b6c33bedcaa0e39 /hash.c
parent6ff237b689590320f942a195193fed3f95934de1 (diff)
downloadtxr-24bfded1413e45bb949f6c1ee2b3e8ef34f12329.tar.gz
txr-24bfded1413e45bb949f6c1ee2b3e8ef34f12329.tar.bz2
txr-24bfded1413e45bb949f6c1ee2b3e8ef34f12329.zip
New type args with DARG type code.
An object of args type captures into the heap the "struct args" argument list that normally appears only on the stack. Such an object also has space for a car and cdr field, which can come in handy. * args.c (dyn_args): New function: hoist a struct args * into an args heap object. * args.h (dyn_args): Declared. * gc.c (finalize, mark_obj): Handle DARGS type code. * hash.c (equal_hash): Handle DARG via eq equivalence. * lib.c (args_s): New symbol variable. (code2type): Map DARG to args symbol. (equal): Handle DARG type, using eq equivalence for now. (obj_init): Initialize args_s with interned symbol. * lib.h (enum type, type_t): New type code, DARG. (struct dyn_args): New struct. (union obj): New member, a of type struct dyn_args. * txr.1: Documented args type under typeof.
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 69b98c1a..9f4df00b 100644
--- a/hash.c
+++ b/hash.c
@@ -218,6 +218,7 @@ ucnum equal_hash(val obj, int *count, ucnum seed)
case SYM:
case PKG:
case ENV:
+ case DARG:
switch (CHAR_BIT * sizeof (mem_t *)) {
case 32:
return coerce(ucnum, obj) >> 4;