Created
December 26, 2009 21:23
-
-
Save lsparrish/264046 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
( Stack and list manipulation. ) | |
: allot heap +! ; | |
: -allot heap -! ; | |
: sav ` dup ` push ; immediate | |
: tempsave ( ?n- ) for here r 1- + ! next ; | |
: tempload ( n-? ) for here r 1- + @ next ; | |
: keepsave ( ?n- ) sav tempsave pop allot ; | |
: keepload ( n-? ) sav -allot pop tempload ; | |
: keep! ( ?n-a ) here push keepsave pop ; | |
: keep@ ( n-?a ) keepload here ; | |
: reverse ( ?n-? ) sav tempsave pop tempload ; | |
: reverse-stack ( ?-? ) depth reverse ; | |
: list ( ?n- ) create dup , keepsave ; | |
dup . | |
1 2 2 4 4 list mylist | |
dup . | |
: test + @ ; | |
: access ( n"- ) 32 accept tib tempString dup getLength eval ( test . ) ; | |
0 access mylist | |
test . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment