{ y takes a list of boxes as input. That's really all you need to think
about. If you gave it more axes, what would it do with them? Since it
runs the items of the opened y together, there's no easy generalization
to higher dimensions. Thus, there are two choices: make rank infinite
and declare that the first thing { does is run its argument into a list;
or make rank 1. Clearly, rank 1 is better here, because its extends
automatically to higher-rank arguments.
On 7/23/2018 8:28 PM, Don Guinn wrote:
I'm not sure this is something to be investigated at this time. Because I
suspect that changing it's rank would not a trivial thing. All I asked is
why the rank was set to 1. It appears pretty useless to me. How useful
would it be if it's rank were infinite? Not much. Simply (<"1) before
passing to ({) gets the same result.
There are probably plenty of other surprises out there in J.
On Mon, Jul 23, 2018 at 6:02 PM Henry Rich <[email protected]> wrote:
Hold on thar! I didn't want { y to work differently, I just misread the
spec. I don't think the current definition has any such restrictions as
you say. Try it with boxes containing whatever type you like.
Henry Rich
On 7/23/2018 6:42 PM, Don Guinn wrote:
It seems like the problem is that Catalogue manadic rank is one. I really
can't see much use in passing it a table or higher rank of boxes. So what
about changing its monadic rank to infinite? It seems to me that that
would
open up interesting possibilities, including as Henry wanted it to work
in
the first place. As of now the things being built restricted to numbers
or
letters. It would not affect anyone using it with a list of boxes as it
would still work the same.
Is there any way to determine the rational for its monadic rank being
one?
On Mon, Jul 23, 2018 at 10:12 AM Henry Rich <[email protected]>
wrote:
No. But no argument for doing so either. Thus, I will not complicate
the code with the special case.
Henry Rich
On 7/23/2018 9:39 AM, Raul Miller wrote:
Any reason to not make the L.0 case for { use the <“1 implementation?
Thanks,
—
Raul
On Sunday, July 22, 2018, Henry Rich <[email protected]> wrote:
I'll get the answer to this one right. <"r is heavily optimized.
Don't
try to replace it.
Henry Rich
On 7/22/2018 7:08 PM, Don Guinn wrote:
Yes. The documentation describes exactly what's happening. The rank 1
is
the key making each number an item. In this case it is the equivalent
to
(<"1) by itself. So, is it a good idea to use ({) in place of (<"1)
when
wanting to box something rank 1? It's shorter and simpler to read.
But
what
about optimization? It seems to me that it would be a neat example in
NuVoc.
On Sun, Jul 22, 2018 at 4:42 PM <[email protected]> wrote:
Henry Rich wrote:
As I read Ye Dic, ({ i. 2 4) should give the same result as
({ <"1 i. 2 3).
I never thought I'd have to say this to *you* but:
note that Catalogue { has rank 1.
Hence there should not be any interaction between the colors in
{ 'black' ,: 'green'
nor in the low / high vectors in
{ i. 2 4
To me, Catalogue { works just fine as-is. In particular, the DoJ
also covers the "open argument" case as it stands.
{ 'black' NB. the same as: { 'b' ; 'l' ; 'a' ;
'c'
; 'k'
+-----+
|black|
+-----+
Quote:
{y forms a catalogue from the atoms of its argument, its
shape
being the chain of the shapes of the opened items of y .
The
common shape of the boxed results is $y .
Martin
[PS 1: the empty shape of the resulting box
$ { 'black'
happens to be a concatenation ("chain") of the five empty letter
shapes
here.
PS 2: Those reading down to here may also be interested in this
short exercise:
What's the result of
{ 'ht' ; 'ao' ; ,. 'gtw'
?
(Just follow the instructions above :-)
]
----------------------------------------------------------------------
For information about J forums see
http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see
http://www.jsoftware.com/forums.htm
---
This email has been checked for viruses by AVG.
https://www.avg.com
----------------------------------------------------------------------
For information about J forums see
http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm