tisp

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

commit c98231e1f49d5a19e86563b5c2d7c0d4e0e1d4c6
parent ccf57036d5da1fef7dde079b595dcd65e8d212a3
Author: Ed van Bruggen <edvb@uw.edu>
Date:   Mon, 23 Apr 2018 09:55:29 -0700

State type that could not be evaluated as function

Have hash_add return void again

Diffstat:
main.c | 5++---
tisp.c | 5++---
2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/main.c b/main.c @@ -23,7 +23,7 @@ hints(const char *buf, int *color, int *bold) { NULL, NULL, 0, 0 } }; for (int i = 0; hint[i].match; i++) { - if (!strcasecmp(buf, hint[i].match)){ + if (!strcasecmp(buf, hint[i].match)) { *color = hint[i].color; *bold = hint[i].bold; return hint[i].hint; @@ -62,8 +62,7 @@ main(int argc, char *argv[]) case 'h': usage(0); case 'v': - printf("%s v%s (c) 2017-2018 Ed van Bruggen\n", argv0, VERSION); - return 0; + die(0, "%s v%s (c) 2017-2018 Ed van Bruggen", argv0, VERSION); default: usage(1); } ARGEND; diff --git a/tisp.c b/tisp.c @@ -168,7 +168,7 @@ hash_grow(Hash ht) } /* create new key and value pair to the hash table */ -Val +void hash_add(Hash ht, char *key, Val val) { Entry e = entry_get(ht, key); @@ -178,7 +178,6 @@ hash_add(Hash ht, char *key, Val val) ht->size++; hash_grow(ht); } - return val; } /* add each binding args[i] -> vals[i] */ @@ -408,7 +407,7 @@ tisp_eval(Hash env, Val v) hash_merge(env, f->v.f.env); return tisp_eval(env, f->v.f.body); default: - warn("attempt to evaluate non primitive"); + warnf("attempt to evaluate non primitive type [%s]", type_str(f->t)); } default: break; }