Interpreter bug with ⎕SIGNAL: a spurious RANK ERROR.
5 posts
• Page 1 of 1
Interpreter bug with ⎕SIGNAL: a spurious RANK ERROR.
Here is some odd INTERPRETER behaviour!!! I'm generating a SIGNAL with an unusual, but legit, unicode character: ⃠ ⎕UCS 128683 (hex 1F6AB) (Note: I replaced Unicode 128683 with 8416 (which looks similar) in this post, because the former triggered an SQL error in the FORUM on SUBMIT). Dyalog APL on MacOS decides there's a rank error in the ⎕SIGNAL message string (left arg), even though said string checks out as a proper character vector.
Here are the system details:
- Code: Select all
)clear
clear ws
ERRch←⎕UCS 128683
ERRch
⃠ ⍝ a non-combining DO NOT ENTER (error) Symbol; contrast ⃠ 8416
(ERRch,'Help me!')⎕SIGNAL 11 ⍝ Bad interpreter?
RANK ERROR: A signalled message must be a character vector or scalar
(ERRch,'Help me!')⎕SIGNAL 11
∧
('Help me!') ⎕SIGNAL 11 ⍝ Expected behaviour
Help me!
('Help me!')⎕SIGNAL 11
∧
m←ERRch,'Help me!' ⍝ Same song, next verse
m
⃠Help me!
m ⎕SIGNAL 11 ⍝ Same refrain
RANK ERROR: A signalled message must be a character vector or scalar
m ⎕SIGNAL 11
∧
(m~⎕UCS 128683) ⎕SIGNAL 11 ⍝ Remove the symbol. All is well.
Help me!
(m~⎕UCS 128683)⎕SIGNAL 11
Here are the system details:
Interpreter:
Version: 17.1.36845
Platform: Mac-64
Edition: Unicode/64
Date: Aug 15 2019 at 00:08:18
Version: 4.2.3437
Platform: MacIntel
Date: 2019-08-13 14:55:17 +0200
Git commit: 691f47856e05a36f70847313b23e061a0cf95392
- petermsiegel
- Posts: 159
- Joined: Thu Nov 11, 2010 11:04 pm
Re: Interpreter bug with ⎕SIGNAL: a spurious RANK ERROR.
Hi, seemingly the []DR of the left argument cannot be 32 bit character:
-Veli-Matti
⎕DR ⎕UCS 65535
160
⎕DR ⎕UCS 65536
320
((⎕UCS 65535),'Help me!')⎕SIGNAL 11
�Help me!
((⎕UCS 65535),'Help me!')⎕SIGNAL 11
∧
((⎕UCS 65536),'Help me!')⎕SIGNAL 11
RANK ERROR: A signalled message must be a character vector or scalar
((⎕UCS 65536),'Help me!')⎕SIGNAL 11
∧
-Veli-Matti
- Veli-Matti
- Posts: 94
- Joined: Sat Nov 28, 2009 3:12 pm
Re: Interpreter bug with ⎕SIGNAL: a spurious RANK ERROR.
Thanks. That's a very good summary of the problem. I had tried Chinese characters (like UCS 20004), but I forgot, those are 16-bit chars and work fine.
Even the other "DO NOT ENTER" ⎕UCS 8416 misbehaves on output depending on what's before or after it, sometimes appearing as blanks and other times as defined, but that may relate to (non-standard) behaviour of combining characters in Dyalog's terminal output routines.
Even the other "DO NOT ENTER" ⎕UCS 8416 misbehaves on output depending on what's before or after it, sometimes appearing as blanks and other times as defined, but that may relate to (non-standard) behaviour of combining characters in Dyalog's terminal output routines.
- petermsiegel
- Posts: 159
- Joined: Thu Nov 11, 2010 11:04 pm
Re: Interpreter bug with ⎕SIGNAL: a spurious RANK ERROR.
I have a two part answer:
- "That's bonkers" was the response to the RANK ERROR - we'll replace that with a DOMAIN ERROR in the next version of Dyalog APL.
- Indeed the interpreter does not support 32-bit characters in ⎕SIGNAL. I've raised an RFE to ask for this, but there's no guarantee that we'll ever implement this.
-
AndyS|Dyalog - Posts: 263
- Joined: Tue May 12, 2009 6:06 pm
Re: Interpreter bug with ⎕SIGNAL: a spurious RANK ERROR.
Thanks for this. It would be great if the reference guide could point out the limitation. Documentation that matches the actual behaviour pays for itself many times over.
- petermsiegel
- Posts: 159
- Joined: Thu Nov 11, 2010 11:04 pm
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group