Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
36
Task/Metaprogramming/Quackery/metaprogramming.quackery
Normal file
36
Task/Metaprogramming/Quackery/metaprogramming.quackery
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
( +---------------------------------------------------+ )
|
||||
( | add inline comments ";" to Quackery with "builds" | )
|
||||
( +---------------------------------------------------+ )
|
||||
|
||||
[ dup $ "" = not while
|
||||
behead carriage =
|
||||
until ] builds ; ( [ $ --> [ $ )
|
||||
|
||||
|
||||
; +---------------------------------------------------+
|
||||
; | add switch to Quackery with ]else[ ]'[ & ]done[ |
|
||||
; +---------------------------------------------------+
|
||||
|
||||
[ stack ] is switch.arg ( --> s )
|
||||
protect switch.arg
|
||||
|
||||
[ switch.arg put ] is switch ( x --> )
|
||||
|
||||
[ switch.arg release ] is otherwise
|
||||
|
||||
[ switch.arg share
|
||||
!= iff ]else[ done
|
||||
otherwise
|
||||
]'[ do ]done[ ] is case ( x --> )
|
||||
|
||||
|
||||
[ switch
|
||||
1 case [ say "The number 1." cr ]
|
||||
$ "two" case [ say 'The string "two".' cr ]
|
||||
otherwise [ say "Something else." cr ] ] is test
|
||||
( x --> )
|
||||
|
||||
|
||||
' tally test ; output should be: Something else.
|
||||
$ "two" test ; output should be: The string "two".
|
||||
1 test ; output should be: The number 1.
|
||||
Loading…
Add table
Add a link
Reference in a new issue