Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Generic-swap/Verbexx/generic-swap.verbexx
Normal file
19
Task/Generic-swap/Verbexx/generic-swap.verbexx
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// user-defined swap verb -- parms are passed by alias, not value, so they can be updated:
|
||||
|
||||
'<==> [_a] @FN [_b] { _a _b = _b _a } by_alias: ;
|
||||
|
||||
|
||||
// test out swap verb
|
||||
|
||||
@VAR a = 12345;
|
||||
@VAR b = "*****";
|
||||
|
||||
@SAY "a=" a " b=" b;
|
||||
|
||||
\b <==> \a; // "\" verb prevents evaluation of a and b here,
|
||||
// so they can be passed by alias to <==>
|
||||
@SAY "a=" a " b=" b;
|
||||
|
||||
a b = b a; // swap them back, just using the usual = verb
|
||||
|
||||
@SAY "a=" a " b=" b;
|
||||
Loading…
Add table
Add a link
Reference in a new issue