Interpreter bug with ⎕SIGNAL: a spurious RANK ERROR.

A forum for issues on macOS; the UNIX and Linux forums may have relevent posts

Interpreter bug with ⎕SIGNAL: a spurious RANK ERROR.

Postby petermsiegel on Fri Nov 15, 2019 7:10 am

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.
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
Lesson learned: Don't use cute characters in error messages.
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: 67
Joined: Thu Nov 11, 2010 11:04 pm

Re: Interpreter bug with ⎕SIGNAL: a spurious RANK ERROR.

Postby Veli-Matti on Sat Nov 16, 2019 1:28 pm

Hi, seemingly the []DR of the left argument cannot be 32 bit character:

      ⎕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: 50
Joined: Sat Nov 28, 2009 3:12 pm

Re: Interpreter bug with ⎕SIGNAL: a spurious RANK ERROR.

Postby petermsiegel on Sat Nov 16, 2019 10:14 pm

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.
petermsiegel
 
Posts: 67
Joined: Thu Nov 11, 2010 11:04 pm

Re: Interpreter bug with ⎕SIGNAL: a spurious RANK ERROR.

Postby AndyS|Dyalog on Tue Nov 19, 2019 11:46 am

I have a two part answer:
  1. "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.
  2. 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.
User avatar
AndyS|Dyalog
 
Posts: 220
Joined: Tue May 12, 2009 6:06 pm

Re: Interpreter bug with ⎕SIGNAL: a spurious RANK ERROR.

Postby petermsiegel on Tue Nov 19, 2019 11:05 pm

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: 67
Joined: Thu Nov 11, 2010 11:04 pm


Return to macOS

Who is online

Users browsing this forum: No registered users and 1 guest