Interpreter bug with ⎕SIGNAL: a spurious RANK ERROR.
Posted: 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.
Lesson learned: Don't use cute characters in error messages.
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