summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@vistahigherlearning.com>2022-09-26 17:01:17 -0400
committerDavid Thompson <dthompson@vistahigherlearning.com>2022-09-26 17:01:17 -0400
commit41d104cf90779e19ffcb15d173c9e98b77efbe36 (patch)
tree75723c2f90b7085f442ade7ed39c3f1702c1bdce
parent275e2efdcec18b8b4c3f3d9ed7235dcdd0c058a6 (diff)
Add dummy output for heap allocated values.
-rw-r--r--test.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/test.c b/test.c
index f41ae64..c2a485f 100644
--- a/test.c
+++ b/test.c
@@ -10,6 +10,11 @@
#define boolean_shift 7
#define boolean_tag 31
#define empty_list 47
+#define heap_mask 7
+#define pair_tag 1
+#define vector_tag 2
+#define string_tag 3
+#define closure_tag 6
int main(int argc, char** argv) {
int val = scheme_entry();
@@ -24,6 +29,14 @@ int main(int argc, char** argv) {
} else {
printf("#f\n");
}
+ } else if((val & heap_mask) == pair_tag) {
+ printf("pair\n");
+ } else if((val & heap_mask) == vector_tag) {
+ printf("vector\n");
+ } else if((val & heap_mask) == string_tag) {
+ printf("string\n");
+ } else if((val & heap_mask) == closure_tag) {
+ printf("closure\n");
} else if(val == empty_list) {
printf("()\n");
}