root/trunk/orca/tests/working/arg_stack.r

Revision 1, 0.6 kB (checked in by krobillard, 3 years ago)

Import orca & thune.

Line 
1REBOL [
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
11myfunc: func [a b c] [
12    probe a
13    probe b
14    probe c
15]
16x: [myfunc 1 reduce [probe x x/2: 2] 3]
17;x: [myfunc 1 reduce [x/2: 2 x/5: 4] 3]
18do 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
Note: See TracBrowser for help on using the browser.