-
-
Save crcx/569391 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
chain: parable | |
{{ | |
create stack here , 10 allot | |
: push stack dup ++ @ ! ; | |
: pop stack dup @ @ swap -- ; | |
: empty? stack dup @ = ; | |
: nest compiler on here push 0 , 0 , ; | |
: unnest pop empty? not !compiler ; | |
---reveal--- | |
: [ nest ; immediate | |
: ] unnest @compiler if 9 , here over 1+ ! 8 over ! 2 + 1 , , ;then 9 , ; immediate | |
}} | |
: __: header ; parsing | |
: def ( a- ) @last !d->xt &.word reclass ; | |
:do [ .word ] def | |
:if [ rot 0 !if drop .word ;then nip .word ] def | |
:ifTrue [ [ ] if ] def | |
:ifFalse [ [ ] swap if ] def | |
:dip [ swap push do pop ] def | |
:loop [ swap for dup dip next drop ] def | |
:loopi [ swap for r swap dup dip next drop ] def | |
;chain |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment