A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
16
Task/Generic-swap/Maxima/generic-swap.maxima
Normal file
16
Task/Generic-swap/Maxima/generic-swap.maxima
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
a: 10$
|
||||
b: 20$
|
||||
|
||||
/* A simple way to swap values */
|
||||
[a, b]: [b, a]$
|
||||
|
||||
a; /* 20 */
|
||||
b; /* 10 */
|
||||
|
||||
/* A macro to hide this */
|
||||
swap(x, y) ::= buildq([x, y], ([x, y]: [y, x], 'done))$
|
||||
|
||||
swap(a, b)$
|
||||
|
||||
a; /* 10 */
|
||||
b; /* 20 */
|
||||
Loading…
Add table
Add a link
Reference in a new issue