tisp

tiny lisp
git clone git://edryd.org/tisp
Log | Files | Refs | LICENSE

commit 29bc2a4b0a2e83bba5a849edf2fda233a61de1e0
parent a60aaa30af90261ceb84baebc7fa3c737724542f
Author: Ed van Bruggen <edvb@uw.edu>
Date:   Wed, 21 Mar 2018 23:31:55 -0700

Print if value is a primitive or function

Diffstat:
tisp.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tisp.c b/tisp.c @@ -460,8 +460,11 @@ tisp_print(Val v) case SYMBOL: printf(v->v.s); break; + case PRIMITIVE: + printf("#<primitive>"); + break; case FUNCTION: - printf("#<closure>"); + printf("#<function>"); break; case PAIR: putchar('('); @@ -481,7 +484,7 @@ tisp_print(Val v) putchar(')'); break; default: - printf("%s: Could not print value type [%d]", argv0, v->t); + printf("%s: could not print value type [%d]", argv0, v->t); } }