[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] Error handling and IO

From: Kacper Gutowski
Subject: Re: [Bug-apl] Error handling and IO
Date: Mon, 11 Apr 2016 09:07:05 +0200

On Mon, Apr 11, 2016 at 5:27 AM, Elias Mårtenson wrote:
> This seems similar to what GNU APL provides with the ⎕EA feature. The
> problem with this (and, as far as I can tell, also with this Dyalog feature)
> is that in an error handler, the original error has disappeared.

If you call some function inside ⎕EA or ⎕EC and then do the clean up, the
only thing you loose is the ability to get suspension inside it.  The
original error type and message is still available in ⎕ET and ⎕EM after
⎕EA or directly returned by ⎕EC.  Sadly, the second and third lines of ⎕EM
showing location where the error occured seem indeed to be left out.
Perhaps this could be improved.  But if you pass it to ⎕ES, it will simply
appear as if said function were fixed as not suspendable,* which makes
sense to some degree because it's not possible to suspend it under ⎕EA or

Having ability to get suspension and then appropriate resources freed on
unwind regardless if it happens normally, after user's corrective action,
or by clearing stack indicator would be pretty cool, but that sounds like
a big leap in the way stack indicator works.



      ⎕FX 'y F x' 'y+x'
      F 1
F[1]  y+x

      0 1 0 0 ⎕FX 'y F x' 'y+x'
      F 1
      F 1
      ^ ^

      ∇R←(F G) x
[1] ⎕ES 0 0 ⋄ ''⎕EA'R←F x'
[2] ⍝ cleanup here
[3] (,1↑[⎕IO]⎕EM) ⎕ES ⎕ET  ∇

      {⍺+⍵}G 1
      G 1
      ^ ^

reply via email to

[Prev in Thread] Current Thread [Next in Thread]