diff options
-rw-r--r-- | test.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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"); } |