Hi again
I have analyzed the problem and it looks like the GNU APL behavior
is sort of correct even
though not very elegant. The background is this:
IBM APL2 says (see ⎕ES, page 282 in the language reference
manual):
When R Is a Character
Scalar or Vector: Normal APL2 error handling is
initiated.
R is displayed as the error message and set in ⎕EM (error
message). ⎕ET
(event type) is
set to 0 1.
∇Z←EXPO A
[1] ⎕ES(0=A)/'ZERO INVALID'
[2] Z←*A
[3] ∇
EXPO 3
2008553692
EXPO 0
ZERO INVALID ⍝ ⎕EM[1;] comments by jsa
EXPO 0 ⍝ ⎕EM[2;]
^ ⍝ ⎕EM[3;]
⎕EM
ZERO INVALID
EXPO 0
^
⎕ET
0 1
This looks kind of nice if the arguments of the function that
throws an error are reasonably small,
like the numeric scalar 0 in the IBM example. In general error
messages in IBM APL consist of 3
lines:
1. an error description,
2. the code line that caused the error, and
3. a line with two carets insdicating the part of the code line
that caused the error,
As can be seen in the EXPO example, in 2 the actual values (not
the formal values) are being displayed.
In your example, the left argument, say A, of the
offending function tb_line is (in boxed form):
┏→━┓ ┏→━┓
┃ID┃ ┃TB┃
┗━━┛ ┗━━┛
┏→┓ ┏→━┓
┃title┃ ┃A Schedule┃
┗━┛ ┗━━┛
┏→┓
┏→━┓
┃lines┃ ↓┏→━┓ 1 ┏→━┓ d
┏→┓ ┃
┗━┛ ┃┃CA┃ ┃Current Assets┃ ┃1010 1110 1310 1320
1390 1410┃ ┃
┃┗━━┛ ┗━━┛
┗━┛ ┃
┃┏→━┓ 10 ┏→━━┓ c
┏→━┓ ┃
┃┃CL┃ ┃Current Liabilities┃ ┃2010 2110
2310┃ ┃
┃┗━━┛ ┗━━━┛
┗━━┛ ┃
┃┏→━━┓ 11 ┏→━┓ c
┏→━━━┓ ┃
┃┃LTD┃ ┃Long-term Debt┃
┃2710┃ ┃
┃┗━━━┛ ┗━━┛
┗┛ ┃
┃┏→━┓ 15 ┏→━┓ c
┏→┓ ┃
┃┃EQ┃ ┃Equity┃ ┃3100
3990┃ ┃
┃┗━━┛ ┗━━┛
┗━┛ ┃
┗∊━┛
┏→━━┓ ┏→━┓
┃fns┃ ┃tb_sched_workpaper┃
┗━━━┛ ┗━━┛
That is, you get
essentially 3 lines :
LINE NAME MUST BE A
CHARACTER STRING ⍝ ⎕EM[1;]
A tb_line_init 'S' 40 'Sales' 'c' 5010 ⍝
⎕EM[2;]
^ ^ ⍝
⎕EM[3;]
except that instead of
the variable name A, the value of A is printed as required
by APL2. Since A is huge and nested, the corresponding string
forthe value of A is
subject to line breaks at ⎕PW, indentation of the subsequent
lines, etc.
One could think about printing A in a nicer way (e.g. boxed) but
I am afraid that
would break other things because other people may evaluate ⎕EM
(which gets a
copy of the offending line) in their advanced debug functions.
My proposal would therefore be that you write a defined function
Quad_ES which
takes care of formatting (boxing ?) large arguments found in
⎕EM[2;] after ⎕ES has
thrown an error.
Best Regards,
Jürgen Sauermann
On 04/16/2018 05:18 PM, Bill Daly
wrote:
Jürgen,
I've attached the my apl library so that you can recreate my bug
if need be.
My problem is the messages generated by Quod-es:
LINE NAME MUST BE A CHARACTER STRING
'ID' 'TB' 'title' 'A Schedule' 'lines' ('CA' 1 'Current
Assets' 'd' (1010 1110 1
310 1320 1390 1410) ' ' 'CL' 10 'Curren
t Liabilities' 'c' (2010 211
0 2310) ' ' 'LTD' 11 'L