Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
18
Task/Generic-swap/REBOL/generic-swap.rebol
Normal file
18
Task/Generic-swap/REBOL/generic-swap.rebol
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
REBOL [
|
||||
Title: "Generic Swap"
|
||||
URL: http://rosettacode.org/wiki/Generic_swap
|
||||
Reference: [http://reboltutorial.com/blog/rebol-words/]
|
||||
]
|
||||
|
||||
swap: func [
|
||||
"Swap contents of variables."
|
||||
a [word!] b [word!] /local x
|
||||
][
|
||||
x: get a
|
||||
set a get b
|
||||
set b x
|
||||
]
|
||||
|
||||
answer: 42 ship: "Heart of Gold"
|
||||
swap 'answer 'ship ; Note quoted variables.
|
||||
print rejoin ["The answer is " answer ", the ship is " ship "."]
|
||||
Loading…
Add table
Add a link
Reference in a new issue