A better explanation than I could give. This is not a beginner issue, but it is
interesting to see how it changes a tree diagram.
f=: 13 :'(i.x)<@|:i.y'
5!:4 <'f'
┌─ [:
┌─────┼─ i.
│ └─ [
│
│ ┌─ <
──┼─ @ ─┴─ |:
│
│ ┌─ [:
└─────┼─ i.
└─ ]
g=: 13 :'(i.x)([:< |:)"1 _ i.y'
5!:4 <'g'
┌─ [:
┌─────┼─ i.
│ └─ [
│ ┌─ [:
│ ┌─────┼─ <
──┼─ " ─┤ └─ |:
│ └─ 1 _
│
│ ┌─ [:
└─────┼─ i.
└─ ]
and it uncovers what needs to be explored to understand what is actually
happening.
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Aai
Sent: Wednesday, November 30, 2011 3:02 AM
To: Programming forum
Subject: Re: [Jprogramming] FW: A simple function
> IMO the role of @ is essential and by removing it you amputate J.
> How would you form trains equivalent to
>
> (i.2 1)<@|: i.2 3
> +---+-----+
> |0 3|0 1 2|
> |1 4|3 4 5|
> |2 5| |
> +---+-----+
By using rank?
<@|: b. 0
_ 1 _
(i.2 1) ([: < |:)"1 _ i.2 3
┌───┬─────┐
│0 3│0 1 2│
│1 4│3 4 5│
│2 5│ │
└───┴─────┘
--
Met vriendelijke groet,
@@i=Arie Groeneveld
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm