new example: unu in retro
FossilOrigin-Name: 5edd4a53544b383fed144cbb40f99ffc9fca62bc7fd6b6fc761a4bfbdddea563
This commit is contained in:
parent
b32cb2b842
commit
6d452fcb97
1 changed files with 22 additions and 0 deletions
22
example/retro-unu.forth
Executable file
22
example/retro-unu.forth
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env retro
|
||||
|
||||
~~~
|
||||
{{
|
||||
'Fenced var
|
||||
:toggle-fence @Fenced not !Fenced ;
|
||||
:fenced? (-f) @Fenced ;
|
||||
:handle-line (s-)
|
||||
fenced? [ over call ] [ drop ] choose ;
|
||||
---reveal---
|
||||
:unu (sq-)
|
||||
swap [ dup '~~~ s:eq?
|
||||
[ drop toggle-fence ]
|
||||
[ handle-line ] choose
|
||||
] file:for-each-line drop ;
|
||||
}}
|
||||
~~~
|
||||
|
||||
~~~
|
||||
#0 sys:argv [ s:put nl ] unu
|
||||
~~~
|
||||
|
Loading…
Reference in a new issue