⎕SIGNAL/
2 posts
• Page 1 of 1
⎕SIGNAL/
While writing code intended to be used as far back as Dyalog v14.0 I recently got hit with an error that I'd managed to avoid for the best part of twenty years because Dyalog introduced another way to avoid it.
v16.0 introduced a shy result to
Since the introducton of the result I've used it a few times in v16.0 forgetting that I had a solution all along that would have worked in v9.0 had I thought of it back then; it actually took me 'til about v11.0 or v12.0.
If b is true m is dropped, the argument to ⎕SIGNAL/ is singleton n and reduction runs its operand exactly zero times on such an argument, returning it unchanged, so the dfn can continue.
If false, reduction inserts ⎕SIGNAL between m and n and signals as expected.
v16.0 introduced a shy result to
[msg] ⎕SIGNAL ⍬that previously had none. Prior to that it was thought to be necessary to place all instances of ⎕SIGNAL within dfns behind guards to avoid the consequences of their not having results when they weren't tiggered.
Since the introducton of the result I've used it a few times in v16.0 forgetting that I had a solution all along that would have worked in v9.0 had I thought of it back then; it actually took me 'til about v11.0 or v12.0.
z←⎕signal/ b ↓ m nwhere m is the error message, n is the error number and b is a boolean scalar indicating no error.
If b is true m is dropped, the argument to ⎕SIGNAL/ is singleton n and reduction runs its operand exactly zero times on such an argument, returning it unchanged, so the dfn can continue.
If false, reduction inserts ⎕SIGNAL between m and n and signals as expected.
-
Phil Last - Posts: 628
- Joined: Thu Jun 18, 2009 6:29 pm
- Location: Wessex
2 posts
• Page 1 of 1
Return to Functional Programming
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group