Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Generic-swap/Slate/generic-swap-1.slate
Normal file
10
Task/Generic-swap/Slate/generic-swap-1.slate
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
x@(Syntax LoadVariable traits) swapWith: y@(Syntax LoadVariable traits) &environment: env
|
||||
"A macro that expands into simple code swapping the values of two variables
|
||||
in the current scope."
|
||||
[
|
||||
env ifNil: [error: 'Cannot swap variables outside of a method'].
|
||||
tmpVar ::= env addVariable.
|
||||
{tmpVar store: x variable load.
|
||||
x variable store: y variable load.
|
||||
y variable store: tmpVar load} parenthesize
|
||||
].
|
||||
1
Task/Generic-swap/Slate/generic-swap-2.slate
Normal file
1
Task/Generic-swap/Slate/generic-swap-2.slate
Normal file
|
|
@ -0,0 +1 @@
|
|||
a `swapWith: b
|
||||
Loading…
Add table
Add a link
Reference in a new issue