From 41d104cf90779e19ffcb15d173c9e98b77efbe36 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Mon, 26 Sep 2022 17:01:17 -0400 Subject: Add dummy output for heap allocated values. --- test.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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"); } -- cgit v1.2.3