I can't give a good answer for question of where this detail needs to
be documented, because I do not adequately understand why this detail
exists.

Taking a step back, for perspective:

catch catches errors even if the debug flag is set. But, it currently
does not trap a stop. Therefore, in the current implementation, a stop
must not be an error.

Proof:
   ex=: {{1+y}}
   exa=: {{try.ex y catch.3 end.}}
   13!:0]1
   13!:3'ex 0'
   exa 9
10

If stops were errors, then exa would have returned 3 instead of 10.

catchd. catches errors only if debugging is disabled. This would mean
that it ignores errors when debugging is enabled. I cannot imagine a
use for this feature in the current implementation (or, really, in any
circumstances -- by that's presumably a limitation of my current
imagination).

(catcht. catches throws. It's not clear from the documentation whether
a throw is an error, but experimentation suggests that it is.)

So it looks like try. temporarily disables suspension unless a catchd.
block is present.

Assuming that the current behavior is the intended behavior, this
suggests that the mention of "the setting of the debug flag 13!:0" and
this behavior belongs on the try. keyword, and not on the catch.
keyword. Additionally, the catchd. keyword should mention that its
presence allows suspension in the try block.

---

Put different, there's two questions from my perspective:

(A) what behavior should be implemented, and
(B) how should that behavior be documented.

Consider this example:

ex=: {{13!:}}
exa=: {{try.ex y catch.3 catchd.4 catcht.5 end.}}
13!:0]1
13!:3'ex 0'
   (;$)exa 10
|stop: ex
|   13!:
|ex[0]
      13!:5''
┌┬───┐
││0 0│
└┴───┘

Here, execution was "resumed" but none of the catch blocks were executed.

I find this behavior puzzling, and I do not feel certain that the
implementation is correct.

Thanks,

-- 
Raul


On Wed, Jan 12, 2022 at 12:03 PM Henry Rich <[email protected]> wrote:
>
> I don't know how you document a detail like this so that users will
> actually see it.  In try. and ( :: ) ?
>
> Henry Rich
>
> On 1/12/2022 9:35 AM, Raul Miller wrote:
> > If try. temporarily turns off debugging, shouldn't that be documented?
> >
> > Thanks,
> >
>
>
> --
> This email has been checked for viruses by AVG.
> https://www.avg.com
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to