From 4c2d32b4573211744189da4d4bb4b883f10f0862 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 22 Mar 2016 17:26:01 +0100 Subject: [PATCH] can't find bug: (map println state) makes the type system create an instance of "map" that expects a void->void function --- TODO.md | 1 - examples/mini.carp | 13 +++---------- src/eval.c | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/TODO.md b/TODO.md index 67fe9005..e406d9a0 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,5 @@ # Compiler Big Features - A deref function that can remove the ref from primitive types? - - (map println state) makes the type system create an instance of "map" that expects a void->void function - Don't compile a function if there's already an adequate build artifact - Compile globals so that they can be mutated (and all references refer to the same storage) - Collect all unification errors and present them in the end diff --git a/examples/mini.carp b/examples/mini.carp index ae532810..a44ef7c3 100644 --- a/examples/mini.carp +++ b/examples/mini.carp @@ -1,14 +1,7 @@ -(defn f [x] - (+ 2.0 x)) +(defn f [] + (domap println &[(copy "hej") (copy "san") (copy "svej") (copy "san")])) -(f 5.0) +(f) (bake f) - -(defn g [] - (f 3.2)) - -(bake g) - - diff --git a/src/eval.c b/src/eval.c index c7b338c0..9a7d33ef 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1031,7 +1031,7 @@ void eval_list(Obj *env, Obj *o) { Obj *val = stack_pop(); global_env_extend(key, val); //printf("def %s to %s\n", obj_to_string(key)->s, obj_to_string(val)->s); - obj_set_meta(val, obj_new_keyword("name"), obj_to_string(key)); + //obj_set_meta(val, obj_new_keyword("name"), obj_to_string(key)); stack_push(val); } else if(HEAD_EQ("def?")) {