Skip to content

Instantly share code, notes, and snippets.

@lsparrish
Created September 8, 2010 00:04
Show Gist options
  • Select an option

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

Select an option

Save lsparrish/569363 to your computer and use it in GitHub Desktop.
: contig variable 0 , allot ;
: linked variable -1 , ;
: >contig .data ` tuck ` @ ` ! ` ++ ;
: <contig .data ` dup ` -- ` @ ` @ ;
: >linked .data ` here ` over ` @ ` , ` swap ` ! ` , ;
: <linked .data ` dup ` @ ` 1+ ` @ ` swap ` dup ` @ ` @ ` swap ` ! ;
: __> dup 1+ @ if >linked ;then >contig ; immediate
: __< dup 1+ @ if <linked ;then <contig ; immediate
100 contig bar
linked foo
10 20 >foo >foo
<foo <foo .s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment