Skip to content

Instantly share code, notes, and snippets.

@lsparrish
Created October 10, 2010 19:10
Show Gist options
  • Select an option

  • Save lsparrish/619478 to your computer and use it in GitHub Desktop.

Select an option

Save lsparrish/619478 to your computer and use it in GitHub Desktop.
( dict contains link to the most recent char word created. )
( m? is the interrupt detector for the lookup function. )
( l? is the lookup function. returns an xt or 0. )
( : starts a char definition. )
( ; calls a char definition. )
variable dict
: m? dup 0 =if nip -1 ( leave 0 on stack after interrupt ) ;then
2dup 1+ @ =if nip 2 + -1 ( leave xt on stack after interrupt );then ;
: l? dict repeat @ m? if; again ;
: __: @ here dict @ , dict ! , compiler on ; parsing
: __; @ l? 0; .word ; parsing
:a .s ;
;a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment