mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-21 14:49:17 +02:00
Fixes to eval's apply
Properly extract the primitive function (via cadr) and compare against the appropriate tag ('primitive).
This commit is contained in:
parent
655ee7c04b
commit
9d34f94c3f
2 changed files with 5 additions and 8 deletions
6
TODO
6
TODO
|
@ -8,12 +8,6 @@ Roadmap:
|
|||
|
||||
Working TODO list:
|
||||
|
||||
- apply seems broken:
|
||||
cyclone> (apply append '((1) (2) (3)))
|
||||
((1) (2) (3))
|
||||
|
||||
This is broken in the interpreter (eval) not in compiled code. probably a deficiency in eval.scm
|
||||
|
||||
- Constructs require for self-hosting
|
||||
|
||||
- vectors
|
||||
|
|
|
@ -1219,9 +1219,12 @@ object apply(object cont, object func, object args){
|
|||
|
||||
case cons_tag:
|
||||
{
|
||||
make_cons(c, func, args);
|
||||
make_cons(c, cadr(func), args);
|
||||
|
||||
if (!nullp(func) && eq(quote_Cyc_191procedure, car(func))) {
|
||||
// TODO: would be better to compare directly against symbol here,
|
||||
// but need a way of looking up this symbol ahead of time.
|
||||
// maybe a libinit() or such is required.
|
||||
if (strncmp(((symbol)car(func))->pname, "primitive", 10) == 0) {
|
||||
((closure)__glo_eval)->fn(3, __glo_eval, cont, &c, nil);
|
||||
} else {
|
||||
printf("Unable to evaluate: ");
|
||||
|
|
Loading…
Add table
Reference in a new issue