[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-apl] ⎕EC return values are incorrect for user-defined errors
From: |
David B. Lamkins |
Subject: |
Re: [Bug-apl] ⎕EC return values are incorrect for user-defined errors |
Date: |
Sun, 01 Jun 2014 17:26:26 -0700 |
Hi Jüergen,
Sorry for the miscommunication.
SVN 306 does fix 2⊃⎕ec. However, 3⊃⎕ec is still incorrect.
3⊃⎕ec should be the same as what ⎕em would have been without ⎕ec in the
case where ⎕ec traps an error.
Specifically: 3⊃⎕ec should be a three-row text array in which line 1 is
the error message (which may be the text provided to a ⎕es), line 2 is
the offending line of code and line 3 is the error caret(s). This is the
same three error-message lines that would have been printed to the APL
session without the ⎕ec.
This behavior is covered elsewhere on page 280 of the IBM Reference. I
apologize for having left the `paragraph 3' reference in my first email.
On Sun, 2014-06-01 at 18:53 +0200, Juergen Sauermann wrote:
> Hi David,
>
> thanks, fixed in SVN 306.
>
> /// Jürgen
>
>
> On 05/31/2014 07:51 PM, David B. Lamkins wrote:
> > 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
> >
> >
> >
> >
> >
> >
>