io2 =: 2 :',:&(,: (v L:0)) (u&.>)'
}. io2 $ alltypes
+--+--+-----+---+-----+-----+-----------+
|67|67|67 56|67 |0 1 2|67 | 0 1 2 3|
| | | | |3 4 5| | 4 5 6 7|
| | | | | | | 8 9 10 11|
| | | | | | | |
| | | | | | |12 13 14 15|
| | | | | | |16 17 18 19|
| | | | | | |20 21 22 23|
+--+--+-----+---+-----+-----+-----------+
| |1 |2 |1 1|2 3 |1 1 1|2 3 4 |
+--+--+-----+---+-----+-----+-----------+
+--+--+-----+---+-----+-----+-----------+
| | |56 | |3 4 5| |12 13 14 15|
| | | | | | |16 17 18 19|
| | | | | | |20 21 22 23|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
+--+--+-----+---+-----+-----+-----------+
|0 |0 |1 |0 1|1 3 |0 1 1|1 3 4 |
+--+--+-----+---+-----+-----+-----------+
NB. }. io2 (,.@([EMAIL PROTECTED] ; $ ; <@(*/@$))) alltypes
rank =: [EMAIL PROTECTED]
shape =: $
size =: */@$
monad =: }.
info =: ,.@(rank ; shape ; <@(size))
monad io2 info alltypes
+---+---+-----+-----+-----+-------+-----------+
|67 |67 |67 56|67 |0 1 2|67 | 0 1 2 3|
| | | | |3 4 5| | 4 5 6 7|
| | | | | | | 8 9 10 11|
| | | | | | | |
| | | | | | |12 13 14 15|
| | | | | | |16 17 18 19|
| | | | | | |20 21 22 23|
+---+---+-----+-----+-----+-------+-----------+
|+-+|+-+|+-+ |+---+|+---+|+-----+|+-----+ |
||0|||1|||1| ||2 |||2 |||3 |||3 | |
|+-+|+-+|+-+ |+---+|+---+|+-----+|+-----+ |
|| |||1|||2| ||1 1|||2 3|||1 1 1|||2 3 4| |
|+-+|+-+|+-+ |+---+|+---+|+-----+|+-----+ |
||1|||1|||2| ||1 |||6 |||1 |||24 | |
|+-+|+-+|+-+ |+---+|+---+|+-----+|+-----+ |
+---+---+-----+-----+-----+-------+-----------+
+---+---+-----+-----+-----+-------+-----------+
| | |56 | |3 4 5| |12 13 14 15|
| | | | | | |16 17 18 19|
| | | | | | |20 21 22 23|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
+---+---+-----+-----+-----+-------+-----------+
|+-+|+-+|+-+ |+---+|+---+|+-----+|+-----+ |
||1|||1|||1| ||2 |||2 |||3 |||3 | |
|+-+|+-+|+-+ |+---+|+---+|+-----+|+-----+ |
||0|||0|||1| ||0 1|||1 3|||0 1 1|||1 3 4| |
|+-+|+-+|+-+ |+---+|+---+|+-----+|+-----+ |
||0|||0|||1| ||0 |||3 |||0 |||12 | |
|+-+|+-+|+-+ |+---+|+---+|+-----+|+-----+ |
+---+---+-----+-----+-----+-------+-----------+
monad =: ,.
1 {"2 monad io2 info alltypes
+-----+-----+-----+-----+-----+-------+-------+
|+-+ |+-+ |+-+ |+---+|+---+|+-----+|+-----+|
||0| ||1| ||1| ||2 |||2 |||3 |||3 ||
|+-+ |+-+ |+-+ |+---+|+---+|+-----+|+-----+|
|| | ||1| ||2| ||1 1|||2 3|||1 1 1|||2 3 4||
|+-+ |+-+ |+-+ |+---+|+---+|+-----+|+-----+|
||1| ||1| ||2| ||1 |||6 |||1 |||24 ||
|+-+ |+-+ |+-+ |+---+|+---+|+-----+|+-----+|
+-----+-----+-----+-----+-----+-------+-------+
|+---+|+---+|+---+|+---+|+---+|+---+ |+----+ |
||2 |||2 |||2 |||2 |||2 |||2 | ||2 | |
|+---+|+---+|+---+|+---+|+---+|+---+ |+----+ |
||1 1|||1 1|||2 1|||1 1|||2 3|||1 1| ||2 12| |
|+---+|+---+|+---+|+---+|+---+|+---+ |+----+ |
||1 |||1 |||2 |||1 |||6 |||1 | ||24 | |
|+---+|+---+|+---+|+---+|+---+|+---+ |+----+ |
+-----+-----+-----+-----+-----+-------+-------+
metaperl.j wrote:
Hello, I would like to execute the monad of my choice against the following
data items:
atom =: 67 NB. atom
vector =: 1 $ 67 NB. trivial vector
vector2 =: 67 56 NB. vector
table =: 1 1 $ 67 NB. trivial table
table2 =: i. 2 3 NB. table
report =: 1 1 1 $ 67 NB. trivial report
report2 =: i. 2 3 4 NB. report
In other words, I want to develop a functional profile of a particular monad
by tossing data a varying dimensions at it.
...
Well, what I want is the data on one line and the results lined up
vertically right below it. Right now, it is hard to see the input-output
relation between each member of alltypes and the result of apply the monad
to tha member:
alltypes
+--+--+-----+--+-----+--+-----------+
|67|67|67 56|67|0 1 2|67| 0 1 2 3|
| | | | |3 4 5| | 4 5 6 7|
| | | | | | | 8 9 10 11|
| | | | | | | |
| | | | | | |12 13 14 15|
| | | | | | |16 17 18 19|
| | | | | | |20 21 22 23|
+--+--+-----+--+-----+--+-----------+
}. &. > alltypes
+++--+-+-----+-+-----------+
|||56| |3 4 5| |12 13 14 15|
||| | | | |16 17 18 19|
||| | | | |20 21 22 23|
+++--+-+-----+-+-----------+
...
For example, the atom 56 and the vector 1 $ 67 have the same printed
representation in the default J console.
Is there some mode that would distinguish the printed representations of
these two? Perhaps even something extremely verbose and SGML-ish would be
nice
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm