183c5bae38
FossilOrigin-Name: d2b8467883db80cb179089e1db1b1ed4dff1f11b4bee7086ee46d83f3ee0136e
25 lines
361 B
Forth
Executable file
25 lines
361 B
Forth
Executable file
#!/usr/bin/env rre
|
|
|
|
This is a simple `echo` style example.
|
|
|
|
~~~
|
|
#0 sys:argc
|
|
~~~
|
|
|
|
Then a simple loop:
|
|
|
|
- duplicate the argument number
|
|
- get the argument as a string
|
|
- display it, followed by a space
|
|
- increment the argument number
|
|
|
|
~~~
|
|
[ dup sys:argv puts sp n:inc ] times
|
|
~~~
|
|
|
|
And at the end, discard the argument number and inject a
|
|
newline.
|
|
|
|
~~~
|
|
drop nl
|
|
~~~
|