5 lines
232 B
Forth
5 lines
232 B
Forth
: history create here cell+ , 0 , -1 , ;
|
|
: h@ @ @ ;
|
|
: h! swap here >r , dup @ , r> swap ! ;
|
|
: .history @ begin dup cell+ @ -1 <> while dup ? cell+ @ repeat drop ;
|
|
: h-- dup @ cell+ @ dup -1 = if abort" End of history" then swap ! ;
|