DEVELOPMENT EDITION · 769442725406
Diagnostics Reference
On this page

B0711: APL text that does not read as APL

Catalog status: active. Default severity: error. Stable name: malformed-code-string. Family: Syntax and source text.

A code string (APL ("...") in Vada, apl"..." in Varc) holds APL text that Verada reads at compile time (see APL). This text has a mistake: a name Verada does not know, two arrays side by side, a bracket that is not closed, a glyph that is not part of Verada's APL (system names such as ⎕IO are not), or an operator without its operands.

Example (Vada)

pragma Extensions_Allowed (On);
procedure Main is
   type Vector is array (Positive range <>) of Integer;
   X : constant Vector := (1, 2, 3);
   Total : constant Integer := APL ("+/ X × Y");
begin
   null;
end Main;

Y is not declared, so the text cannot be read: Verada must know what each name in it is (an array or a function) to know how the phrase parses.

What to do

Declare the name, or correct the text. Names in APL text are the host's own names, visible where the code string stands.

The subset, and what is outside it

Verada's APL has the scalar functions (+ - × ÷ ⌈ ⌊ | * ⍟ ○ ! = ≠ < ≤ > ≥ ∧ ∨ ⍲ ⍱ ~), ⍳ ≢ ≡ ⍴ , ⍪ ⌽ ⊖ ⍉ ↑ ↓ ⌷ ⍸, membership ∊, index of (dyadic ⍳), compress and replicate (/), the grades ⍋ ⍒, reduction and scan along either axis, each, commute, outer and inner products, the rank operator, compose and bind ∘, ⍥ ⍛, the power ⍣ with a count written out, at @, dfns without recursion, local names and trains, in Vada (APL ("...")), Varc (apl"...") and Vibe (apl("..."), or apl(r"...") when the text holds \). The message names a glyph that is outside it and says why:

In the REPL, :apl reads each line as APL text over the session's names, and a backtick and a key give a glyph (`i is ⍳, `r is ⍴, `$ is ⍋; typing glyphs gives the whole table).

Regression source and further reading

Complete regression example: source, command arguments and expected results. The fixture deliberately reproduces this diagnostic.

See syntax and source text, the code index, and diagnostic interpretation for modes, replay, fix-its and JSON.