13!:0 y
|
Reset. Reset stack and disable (0) or enable
(1) suspension. Nearly all the facilities in the 13!:
family require that suspension enabled; all the examples below
assume that suspension is enabled: 13!:0 ]1
|
|
13!:1 y |
Display Stack. See also 13!:18.
|
|
13!:2 y |
Query Stops.
|
|
13!:3 y |
Set Stops. Explicit stops are requested by name and
line number in the argument y, which contains zero
or more stop specifications separated by semicolons.
Each stop specification indicates a name, line numbers (if any)
for the monadic case, a colon, and line numbers (if any) for
the dyadic case. An asterisk indicates "all", and a tilde indicates
"except for". For example:
13!:3 'f 0' |
f monadic line 0 |
13!:3 'f :2' |
f dyadic line 2 |
13!:3 'f 0 2:1' |
f monadic 0 2, dyadic 1 |
13!:3 'f 0; g :*' |
f monadic 0 and g all dyadic |
13!:3 '* 0:0' |
monadic 0 and dyadic 0 |
13!:3 'a* *:*; ~ab* *:*' |
All monadic and dyadic whose names begin with a,
except for any beginning with ab |
f=: 3 : 0
10
11
:
20
)
13!:3 'f 1:0' Stop at f monad line 1, dyad line 0
f ''
|stop: f
| 11
|f[1]
13!:0 ]1 Clear stack and enable suspension
3 f 4
|stop: f
| 20
|f[:0]
|
13!:4 y |
Run Again. Resume execution at the current line. For example:
g=: 3 : ('t=. 2*y.'; '1+t')
3 4,g 'abc'
|domain error: g
| t=.2 *y.
|g[0]
y. six-space indent indicates suspension
abc Local value of y.
y.=. 25 Redefine local value of y.
13!:4 '' Run again
3 4 51
|
13!:5 y |
Run Next. Resume execution at the next line.
For example:
h=: 3 : ('t=. 2 3*y.'; '1+t')
3 4,h 5 6 7
|length error: h
| t=.2 3 *y.
|h[0]
t=. 99 six-space indent indicates suspension
13!:5 '' Run next
3 4 100
|
13!:6 y |
Exit and Return. Exit the verb/adverb/conjunction at the top
of the stack, returning result y . For example:
g=: 3 : ('t=. 2*y.'; '1+t')
3 4,g 'abc'
|domain error: g
| t=.2 *y.
|g[0]
13!:6 [9 Exit g with result 9
3 4 9
h=: 2&*
3 4,h 'abc'
|domain error: h
|h[0]
13!:6 [97 Exit h with result 97
3 4 97
|
13!:7 y |
Continue. Resume execution at line number y
|
|
[x] 13!:8 y |
Signal. Signal error number {.,y
(see 9!:8) with optional text x
|
|
[x] 13!:9 y |
Rerun. Resume execution by rerunning the verb/adverb/conjunction
on the top of the stack with the specified arguments. Thus:
plus=: +
plus/'abc'
|domain error: plus
|plus[:0]
13!:13 '' See below re interpretation of stack
+----+-+-+-+-++-----+--+
|plus|3|0|3|+||+-+-+| |
| | | | | |||b|c|| |
| | | | | ||+-+-+| |
+----+-+-+-+-++-----+--+
2 (13!:9) 3 Rerun, getting another error
|domain error: plus
|plus[:0]
13!:13 '' Note left and right args ('a' and 5)
+----+-+-+-+-++-----+--+
|plus|3|0|3|+||+-+-+| |
| | | | | |||a|5|| |
| | | | | ||+-+-+| |
+----+-+-+-+-++-----+--+
1 (13!:9) 5 Rerun
6
|
[x]13!:10 y |
Rerun Execute. Rerun with specified executed arguments
|
|
13!:11 y
|
Error Number. Last error number
|
|
13!:12 y
|
Error Message. Last error message
|
|
13!:13 y |
Stack. If suspension is enabled, 13!:13 ''
produces an 8-column matrix of information on the verbs/adverbs/conjunctions
on the stack:
0 | Name |
1 | Error number or 0 if not in error |
2 | Line number |
3 | Name class: 3, 1, or 2, denoting verb, adverb, or conjunction |
4 | Linear representation of the entity |
5 | The name of the defining script |
6 | Argument(s) individually boxed |
7 | Locals as a 2-column matrix of name and value |
In the last two columns, nouns are included per se, and verb,
adverb, and conjunction are represented by linear forms. For example:
mean=: sum % #
sum=: plus/
plus=: 4 : 'x.+y.'
mean 'abcd'
|domain error: plus
| x. +y.
|plus[:0]
13!:13 '' Note tacit definitions have no locals
+----+-+-+-+-----------++------+------+
|plus|3|0|3|4 : 'x.+y.'||+-+-+ |+--+-+|
| | | | | |||c|d| ||x.|c||
| | | | | ||+-+-+ |+--+-+|
| | | | | || ||y.|d||
| | | | | || |+--+-+|
+----+-+-+-+-----------++------+------+
|sum |0|0|3|plus/ ||+----+| |
| | | | | |||abcd|| |
| | | | | ||+----+| |
+----+-+-+-+-----------++------+------+
|mean|0|0|3|sum % # ||+----+| |
| | | | | |||abcd|| |
| | | | | ||+----+| |
+----+-+-+-+-----------++------+------+ |
13!:14 y |
Query Latent Expression.
|
|
13!:15 y
|
Set Latent Expression. The latent expression is executed
when execution is about to be suspended; error messages are suppressed;
any continuation must be programmed in the latent expression.
|
|
13!:16 y |
Trace. See below.
|
|
13!:17 y |
Query. Is suspension enabled? (Set by 13!:0)
|
|
13!:18 y |
Stack Text. Like 13!:1, but gives the stack
as a literal matrix.
|