>>  <<  Usr  Pri  JfC  LJ  Phr  Dic  Voc  !:  Help  Dictionary

J. Errors and Suspension

Execution of a sentence suspends when an error occurs, and an error message and context information are then displayed. Four blanks indicate where parsing stopped. Suspension may occur in immediate execution, in the execution of a script file, or in the execution of a user-defined named verb, adverb, or conjunction, as illustrated by the following examples:

Immediate execution

   2+'a'
|domain error
|   2    +'a'

Execution of a script file

   t=: '2*3',(10{a.),'2+''a''',(10{a.),'2+3'
   t                          A script
2*3
2+'a'
2+3

   t 1!:2 <'test'             Write script file

   0!:011 <'test'             Execute file, continue on error, display (011)
2*3
6

   2+'a'
   2+3
5

   0!:001 <'test'             Execute file, stop on error, display (001)
   2*3
6

   2+'a'
|domain error
|   2    +'a'
|[-2]

User-Defined Verb

   g=: 3 : ('1+y' ;  ':' ; '2+x+y')

   3+g 'a'
|domain error: g
|   1    +y

   13!:0 (1)                  Enable suspension
   3+g 'a'
|domain error: g
|   1    +y
|g[0]

      y                       Six-space indent indicates suspension
a

      y=. 12                  Redefine local value of y

      13!:4 ''                Resume execution at the current line
16                            Result using redefined value of y
Sentences can be executed in the suspended environment, local values can be accessed, and execution can be resumed. Errors cause suspension only if suspension is enabled (by the phrase 13!:0]1). When suspension is in effect, the input prompt is six spaces.

Suspension and debugging facilities are controlled by the 13!: family as described in Appendix A. A complete list of errors is shown in Appendix D.




>>  <<  Usr  Pri  JfC  LJ  Phr  Dic  Voc  !:  Help  Dictionary