Map in function position

This commit is contained in:
Simon Brooke 2019-02-07 13:57:37 +00:00
parent 86ccdfa4be
commit 897d5d2670

View file

@ -33,9 +33,11 @@
#include "intern.h" #include "intern.h"
#include "io.h" #include "io.h"
#include "lispops.h" #include "lispops.h"
#include "map.h"
#include "print.h" #include "print.h"
#include "read.h" #include "read.h"
#include "stack.h" #include "stack.h"
#include "vectorspace.h"
/* /*
* also to create in this section: * also to create in this section:
@ -288,6 +290,7 @@ struct cons_pointer
/* just pass exceptions straight back */ /* just pass exceptions straight back */
result = fn_pointer; result = fn_pointer;
break; break;
case FUNCTIONTV: case FUNCTIONTV:
{ {
struct cons_pointer exep = NIL; struct cons_pointer exep = NIL;
@ -336,6 +339,20 @@ struct cons_pointer
} }
} }
break; break;
case VECTORPOINTTV:
switch ( pointer_to_vso(fn_pointer)->header.tag.value) {
case MAPTV:
/* \todo: if arg[0] is a CONS, treat it as a path */
result = c_assoc( eval_form(frame,
frame_pointer,
c_car( c_cdr( frame->arg[0])),
env),
fn_pointer);
break;
}
break;
case NLAMBDATV: case NLAMBDATV:
{ {
struct cons_pointer next_pointer = struct cons_pointer next_pointer =
@ -352,6 +369,7 @@ struct cons_pointer
} }
} }
break; break;
case SPECIALTV: case SPECIALTV:
{ {
struct cons_pointer next_pointer = struct cons_pointer next_pointer =
@ -371,6 +389,7 @@ struct cons_pointer
} }
} }
break; break;
default: default:
{ {
int bs = sizeof( wchar_t ) * 1024; int bs = sizeof( wchar_t ) * 1024;