retroforth/example/Echo.retro
crc 47b3e54be2 examples: fix error in example/Echo.retro
FossilOrigin-Name: 7aceecc44a8c4c4d3845f52dc0a85cf85c0550d3b85fe544abe49da4c52ef4bd
2020-10-07 12:25:56 +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
~~~