retroforth/example/echo.retro
crc 9e03717deb normalize names for examples (with a couple of exceptions), closes #38
FossilOrigin-Name: 088675e452ed86a712563c8b2597fe4d47da59bdea0e40becdd1e028a84c47b0
2021-01-24 01:13:04 +00:00

25 lines
383 B
Text
Executable file

#!/usr/bin/env retro
This is a simple `echo` style example.
~~~
#0 script:arguments
~~~
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
~~~