Have you heard the good news about the forth meme?
irc: #forth @freenode
discord: https://discord.gg/sBaeG2a
Trying forth: https://skilldrick.github.io/easyforth/
Learning forth:
https://www.forth.com/starting-forth/1-forth-stacks-dictionary/
https://repl.it/languages/forth
getting forth in ubuntu:
sudo apt-get install gforth
The forth meme is alive folks. It's tremendous. I am amazed how great forth is. Simply incredible.
Look at this forth I wrote you guys
: true? cr if ." true" else ." false" then cr ;
variable end-of-list
variable recycled-lists here 2 cells allot dup end-of-list swap cell + ! recycled-lists !
: link recycled-lists @ dup cell + @ end-of-list =
if
drop here 2 cells allot
else
dup cell + @ recycled-lists !
then ;
: list link dup end-of-list swap cell + ! ;
: push link tuck cell + ! tuck ! ;
: spool list swap 0 do push loop ;
: recycle-cell dup 0 swap ! dup recycled-lists @ swap cell + ! recycled-lists ! ;
: safe-pop dup @ swap cell + @ ;
: pop safe-pop swap recycle-cell ;
: unspool begin pop dup cell + @ end-of-list = until recycle-cell ;
: safe-pop dup @ swap cell + @ ;
: copy-spool begin safe-pop dup cell + @ end-of-list = until drop ;