|
Revision 1, 0.7 kB
(checked in by krobillard, 3 years ago)
|
|
Import orca & thune.
|
| Line | |
|---|
| 1 | REBOL[] |
|---|
| 2 | |
|---|
| 3 | f: func [a /opt b c] [ print c ] |
|---|
| 4 | f/opt 1 2 3 |
|---|
| 5 | ;3 |
|---|
| 6 | f 1 |
|---|
| 7 | ;none |
|---|
| 8 | |
|---|
| 9 | ;>> f/opt 1 2 |
|---|
| 10 | ;** Script Error: f is missing its c argument |
|---|
| 11 | ;** Near: f/opt 1 2 |
|---|
| 12 | |
|---|
| 13 | f: func [a /o b /j c] [ print c ] |
|---|
| 14 | f 1 |
|---|
| 15 | ;none |
|---|
| 16 | |
|---|
| 17 | f: func [a /o b /j c] [ print [b c] ] |
|---|
| 18 | f 1 |
|---|
| 19 | ;none none |
|---|
| 20 | |
|---|
| 21 | ;>> f/j 2 |
|---|
| 22 | ;** Script Error: f is missing its c argument |
|---|
| 23 | ;** Near: f/j 2 |
|---|
| 24 | |
|---|
| 25 | f/j 1 2 |
|---|
| 26 | ;none 2 |
|---|
| 27 | |
|---|
| 28 | f/o 1 2 |
|---|
| 29 | ;2 none |
|---|
| 30 | |
|---|
| 31 | f/j/o 1 2 3 |
|---|
| 32 | ;3 2 |
|---|
| 33 | |
|---|
| 34 | f/o/j 1 2 3 |
|---|
| 35 | ;2 3 |
|---|
| 36 | |
|---|
| 37 | f/j/j 1 2 3 |
|---|
| 38 | ;none 3 |
|---|
| 39 | |
|---|
| 40 | f: func [a /b b /j c] [ print [b c] ] |
|---|
| 41 | f/b 1 2 |
|---|
| 42 | ;true none |
|---|
| 43 | |
|---|
| 44 | ;>> f/b/k 1 2 |
|---|
| 45 | ;** Script Error: f has no refinement called k |
|---|
| 46 | ;** Near: f/b/k 1 2 |
|---|
| 47 | |
|---|
| 48 | ;>> f/b/b/b 1 2 |
|---|
| 49 | ;** Script Error: f is missing its b argument |
|---|
| 50 | ;** Near: f/b/b/b 1 2 |
|---|
| 51 | |
|---|
| 52 | f/b/b/b 1 2 3 4 |
|---|
| 53 | ;true none |
|---|
| 54 | |
|---|
| 55 | o: context [ f: func [a /b b /j c] [ print [b c] ] ] |
|---|
| 56 | o/f/b 1 2 |
|---|
| 57 | ;true none |
|---|
| 58 | |
|---|