The Lambda Lab
/
projects
/
scheme.forth.jl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
23fde15
)
Added expression sequences to macro expander.
author
Tim Vaughan
<tgvaughan@gmail.com>
Mon, 12 Jun 2017 11:40:12 +0000
(23:40 +1200)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Mon, 12 Jun 2017 21:14:28 +0000
(09:14 +1200)
src/scheme.4th
patch
|
blob
|
history
diff --git
a/src/scheme.4th
b/src/scheme.4th
index
67b656c
..
0722208
100644
(file)
--- a/
src/scheme.4th
+++ b/
src/scheme.4th
@@
-1757,12
+1757,9
@@
hide env
defer expand
: expand-quasiquote ;
defer expand
: expand-quasiquote ;
-: expand-definition ;
-: expand-assignment ;
: expand-define-macro ;
: expand-if ;
: expand-lambda ;
: expand-define-macro ;
: expand-if ;
: expand-lambda ;
-: expand-begin ;
: expand-application ;
: expand-macro ( exp -- result )
: expand-application ;
: expand-macro ( exp -- result )
@@
-1801,6
+1798,27
@@
defer expand
cons cons cons ;
cons cons cons ;
+: expand-sequence ( exp -- res )
+ nil? if exit then
+
+ 2dup car expand
+ 2swap cdr recurse
+
+ cons ;
+
+: expand-begin ( exp -- res )
+ begin-symbol 2swap
+ begin-actions expand-sequence
+
+ cons ;
+
+: expand-lambda ( exp -- res )
+ lambda-symbol 2swap
+ 2dup lambda-parameters
+ 2swap lambda-body expand-sequence
+
+ cons cons ;
+
:noname ( exp -- result )
expand-macro
:noname ( exp -- result )
expand-macro