Skip to content

Instantly share code, notes, and snippets.

@crcx
Created February 8, 2009 20:25
Show Gist options
  • Save crcx/60494 to your computer and use it in GitHub Desktop.
Save crcx/60494 to your computer and use it in GitHub Desktop.
\ 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