|
Revision 1, 0.6 kB
(checked in by krobillard, 3 years ago)
|
|
Import orca & thune.
|
| Line | |
|---|
| 1 | REBOL [ |
|---|
| 2 | purpose: {Shows 3 things: |
|---|
| 3 | 1. REBOL copies each argument value onto the data stack - it does not |
|---|
| 4 | just keep a refrence to the value in the block (C pointer). |
|---|
| 5 | If it only pushed a reference then 'probe a' should print '2'. |
|---|
| 6 | 2. probe returns the value probed. |
|---|
| 7 | 3. set-path! returns the series value referenced. |
|---|
| 8 | } |
|---|
| 9 | ] |
|---|
| 10 | |
|---|
| 11 | myfunc: func [a b c] [ |
|---|
| 12 | probe a |
|---|
| 13 | probe b |
|---|
| 14 | probe c |
|---|
| 15 | ] |
|---|
| 16 | x: [myfunc 1 reduce [probe x x/2: 2] 3] |
|---|
| 17 | ;x: [myfunc 1 reduce [x/2: 2 x/5: 4] 3] |
|---|
| 18 | do x |
|---|
| 19 | |
|---|
| 20 | [myfunc 1 reduce [probe x x/2: 2] 3] |
|---|
| 21 | ; 1 |
|---|
| 22 | [[myfunc 2 reduce [probe x x/2: 2] 3] [myfunc 2 reduce [probe x x/2: 2] 3]] |
|---|
| 23 | ; 3 |
|---|
| 24 | |
|---|