See the IBM Reference, page 280, paragraph 3.

When ⎕EC executes an expression that signals a user-defined error, the
second and third items of the result should be the same as the
expression's ⎕ET (which would be 0 1 in this case) and ⎕EM. GNU APL
returns 0 0 and 'User defined error'.

Note also that ⎕ET must not be changed by ⎕EC. GNU APL already does this
correctly.

It's not clear from the IBM Reference whether ⎕EM should also not be
changed by ⎕EC. It seems reasonable to assume that *not* changing ⎕EM is
the correct behavior; the whole point of ⎕EC is to execute an expression
in a controlled manner. If so, GNU APL is already correct in this
regard.


      ⎕es 'foo'
foo
      ⎕ES 'foo'
      ^
      ⎕em
foo            
      ⎕ES 'foo'
      ^        
      ⎕et
0 1
      ⎕ec '⎕es ''foo'''
 0  0 0  User defined error 
      ⎕em






Reply via email to