Add .frt samples for Forth.

This commit is contained in:
Lars Brinkhoff
2014-09-30 07:01:35 +02:00
parent 86b4de89bd
commit 7a2be16d77
3 changed files with 23 additions and 0 deletions

8
samples/Forth/macros.frt Normal file
View File

@@ -0,0 +1,8 @@
\ Simplifies compiling words.
: [[ ; immediate
: '<> >in @ ' swap >in ! <> ;
: (]]) begin dup '<> while postpone postpone repeat drop ;
: ]] ['] [[ (]]) ; immediate
( Usage: : foo ]] dup * [[ ; immediate : bar 42 foo . ; )