bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] Preventing display of too large arrays


From: David B. Lamkins
Subject: Re: [Bug-apl] Preventing display of too large arrays
Date: Thu, 01 May 2014 09:49:19 -0700

On Wed, 2014-04-30 at 17:29 +0200, Juergen Sauermann wrote:
> Hi,
> 
> maybe some ⎕SYL limit could work. Currently we have such limits on the 
> depth of the SI,
> on the number of values, and on the number of ravel bytes. This was to 
> limit infinite recursion of
> user-defined functions. When such a limit is reached then an ATTENTION 
> is thrown and you can decide
> to continue (→'') or to escape (→) or to change the value for example.
> 

This would be nice to have, but...

It seems to me that the tricky part would be limiting the visual length
of the output. (Obviously, it doesn't do any good to limit printing
based upon the ravel length of a value that can have arbitrarily complex
elements.)

Limiting the visual length might involve a session-level variable that
gets zeroed just before output starts, then incremented with the count
of printed characters in each and every routine. Easy to say; less easy
to get right (and keep right).

It may be easier in the long run to check for the keyboard attention
signal more often.

Meanwhile, one might be able to write a `safe print' function in APL.
The function would recursively walk a given value, accumulating its
print length. If the length is less than a specified limit, print the
value; otherwise, signal an error using quad-ES.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]