Created
August 29, 2010 20:39
-
-
Save lsparrish/556671 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( stack for nesting quotes ) | |
chain: quote | |
create stack here , 10 allot | |
: push stack dup ++ @ ! ; | |
: pop stack dup @ @ swap -- ; | |
: empty? stack dup @ = ; | |
;chain | |
chain: parable | |
: __: header ; parsing | |
: nest compiler on here \quote.push 0 , 0 , ; | |
: unnest \quote.pop \quote.empty? not !compiler ; | |
: [ nest ; immediate | |
: ] unnest @compiler if 9 , here over 1+ ! 8 over ! 2 + 1 , , ;then 9 , ; immediate | |
: def ( a- ) @last &.word over !d->class !d->xt ; | |
[ rot if drop .word ;then nip .word ] :if def | |
[ [ ] if ] :ifTrue def | |
[ [ ] swap if ] :ifFalse def | |
;chain | |
with parable | |
-1 [ 10 . ] [ 20 . ] if | |
[ 0 [ 10 . ] [ 20 . ] if ] :foo def foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment