retroforth/example/Echo.retro
crc 660e52bdcb rename words in sys: to script: (old names still work in this release, but are deprecated)
FossilOrigin-Name: 1a43743f43076eb087ee4dd7fbfa96b8dfda2aa4ddcff41e6a5a9634ba6e239c
2020-09-14 19:55:02 +00:00

25 lines
386 B
Text
Executable file

#!/usr/bin/env retro
This is a simple `echo` style example.
~~~
#0 script:get-argument
~~~
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 script:get-argument s:put sp n:inc ] times
~~~
And at the end, discard the argument number and inject a
newline.
~~~
drop nl
~~~