Created
February 8, 2009 20:25
-
-
Save crcx/60494 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
\ some evil code from crc (ala retro-forth) | |
\ ------------------------------------------------------------------------ | |
\ : skip-colon-start | |
\ r> 9 + >r ; | |
\ | |
\ : :: | |
\ compile skip-colon-start | |
\ [compile] [ reveal | |
\ head, ,call nest ] ; immediate | |
: :: | |
reveal \ reveal outer definition or it wont get | |
compile branch >mark \ compile branch over top of inner definition | |
[compile] : \ create inner definition | |
>resolve ; immediate \ resolve branch | |
\ ------------------------------------------------------------------------ | |
\ example... | |
\ :: foo 1 : bar 2 + . cr ; | |
\ | |
\ typing foo returns 3 | |
\ typing 6 bar returns 8 | |
\ ======================================================================== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment