Working on quasi-quoted forms
parent
8199a19571
commit
7372423e4b
|
@ -60,10 +60,18 @@ PRIVATE>
|
||||||
: convert-quoted ( cons -- quot )
|
: convert-quoted ( cons -- quot )
|
||||||
cdr 1quotation ;
|
cdr 1quotation ;
|
||||||
|
|
||||||
|
: convert-unquoted ( cons -- quot )
|
||||||
|
"unquote not valid outside of quasiquote!" throw ;
|
||||||
|
|
||||||
|
: convert-quasiquoted ( cons -- newcons )
|
||||||
|
[ ] traverse ;
|
||||||
|
|
||||||
: form-dispatch ( lisp-symbol -- quot )
|
: form-dispatch ( lisp-symbol -- quot )
|
||||||
name>>
|
name>>
|
||||||
{ { "lambda" [ convert-lambda ] }
|
{ { "lambda" [ convert-lambda ] }
|
||||||
{ "quote" [ convert-quoted ] }
|
{ "quote" [ convert-quoted ] }
|
||||||
|
{ "unquote" [ convert-unquoted ] }
|
||||||
|
{ "quasiquote" [ convert-quasiquoted ] }
|
||||||
{ "if" [ convert-if ] }
|
{ "if" [ convert-if ] }
|
||||||
{ "begin" [ convert-begin ] }
|
{ "begin" [ convert-begin ] }
|
||||||
{ "cond" [ convert-cond ] }
|
{ "cond" [ convert-cond ] }
|
||||||
|
@ -125,4 +133,4 @@ M: no-such-var summary drop "No such variable" ;
|
||||||
name>> macro-env get at ;
|
name>> macro-env get at ;
|
||||||
|
|
||||||
: lisp-macro? ( car -- ? )
|
: lisp-macro? ( car -- ? )
|
||||||
dup lisp-symbol? [ name>> macro-env get key? ] [ drop f ] if ;
|
dup lisp-symbol? [ name>> macro-env get key? ] [ drop f ] if ;
|
||||||
|
|
Loading…
Reference in New Issue