How about passing the result to a user-configurable J verb and then
showing the output of that as well as (or instead of) the original
result. Something like:
x =: option NB. 0 -> off, 1 -> as-well-as(default), 2 -> instead-of
y =: verb NB. J verb as string or gerund
x showinfo y NB. e.g. showinfo =: (9 !: something)
A verb which just shows the shape and type would probably do. E.g.:
t1 =: ;: 'Bool Char Int Float Complex Boxed ExtInt Rational Other'
t2 =: 2 ^ i.8
v =: 'Shape: (' , ":@$ , '), Type: ' , t1 ;@{~ t2 i. 3!:0
vb =: v L: 0
showinfo 5!:5 <'v' NB. Simulated output follows...
10
10
Shape: (), Type: Int
,10
10
Shape: (1), Type: Int
,: 0 1
0 1
Shape: (1 2), Type: Bool
": 0 1
0 1
Shape: (3), Type: Char
0 1 % 1.0
0 1
Shape: (2), Type: Float
''
Shape: (0), Type: Char
0 0 0 0$a:
Shape: (0 0 0 0), Type: Boxed
showinfo 5!:5 <'vb' NB. For boxed structures
0;'1';2
+-+-+-+
|0|1|2|
+-+-+-+
+---------------------+---------------------+--------------------+
|Shape: (), Type: Bool|Shape: (), Type: Char|Shape: (), Type: Int|
+---------------------+---------------------+--------------------+
0 showinfo '' NB. Back to plain result display
[EMAIL PROTECTED] wrote:
Message: 2
Date: Wed, 8 Oct 2008 09:28:13 +1300
From: "Sherlock, Ric" <[EMAIL PROTECTED]>
---Randy MacDonald wrote:
> I guess all that I can say is that rank coloring wouldn't solve any
> problems that $x doesn't. The existing syntax coloring
> already taxes my
> cognitive powers, as it has done since color came to APL+PC.
Yes $x will tell you the same information, but you would have to think to check
it. Colouring by rank would visually prompt you that something is different
without you doing anything extra.
I don't think you'd be part of the target audience of such a feature and if it
was implemented as envisaged you'd be able to turn it off (as you can with the
existing syntax colouring) - to the relief of your cognitive powers.
However it seems that rank colouring wouldn't be very easy to implement, so a
user-configurable version of Roger's suggestion below might serve the same
purpose and more.
---Roger Hui wrote:
> Rather than tacking more stuff onto the session output
> window, perhaps there could be a "information on the
> last result" window. It would display things like:
>
> - noun/verb/adverb/conjunction
> - if noun,
> - the internal type
> - rank
> - shape
> - # elements (*/shape)
> - ": representation as well as linear, boxed, etc.
> - number of bytes
> etc.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm