add read-time eval
This commit is contained in:
parent
e339b7c64a
commit
d62727bef9
14
src/read.c
14
src/read.c
|
@ -149,6 +149,18 @@ read_directive(pic_state *pic, struct pic_port *port, int c)
|
||||||
return read_comment(pic, port, c);
|
return read_comment(pic, port, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static pic_value
|
||||||
|
read_eval(pic_state *pic, struct pic_port *port, int c)
|
||||||
|
{
|
||||||
|
pic_value form;
|
||||||
|
|
||||||
|
UNUSED(c);
|
||||||
|
|
||||||
|
form = read(pic, port, next(port));
|
||||||
|
|
||||||
|
return pic_eval(pic, form, pic->lib);
|
||||||
|
}
|
||||||
|
|
||||||
static pic_value
|
static pic_value
|
||||||
read_quote(pic_state *pic, struct pic_port *port, int c)
|
read_quote(pic_state *pic, struct pic_port *port, int c)
|
||||||
{
|
{
|
||||||
|
@ -655,6 +667,8 @@ read_dispatch(pic_state *pic, struct pic_port *port, int c)
|
||||||
return read_label(pic, port, c);
|
return read_label(pic, port, c);
|
||||||
case 'u':
|
case 'u':
|
||||||
return read_unsigned_blob(pic, port, c);
|
return read_unsigned_blob(pic, port, c);
|
||||||
|
case '.':
|
||||||
|
return read_eval(pic, port, c);
|
||||||
default:
|
default:
|
||||||
read_error(pic, "unexpected dispatch character");
|
read_error(pic, "unexpected dispatch character");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue