I can¹t add to Dan¹s explanation at all, it is perfect.  I would only
mention that when I need to ³see² how I might wish to apply rank, I
sometimes ³enclose on rank² first to break into the desired cells, then
apply to each cell.  I find it then easier to derive Dan²s solution for
example...

   '0'= ": example
0 0 0 0 1
1 0 0 0 0
0 0 1 0 1
0 0 0 0 0
1 0 1 0 0
0 0 0 0 1
1 0 0 0 0
0 0 1 0 1
0 0 0 0 0
   <"1 '0'= ": example
+---------+---------+---------+---------+ ... +---------+---------+
|0 0 0 0 1|1 0 0 0 0|0 0 1 0 1|0 0 0 0 0| ... |0 0 1 0 1|0 0 0 0 0|
+---------+---------+---------+---------+ ... +---------+---------+
   I.&.> <"1 '0'= ": example
+-+-+---++---+-+-+---++
|4|0|2 4||0 2|4|0|2 4||
+-+-+---++---+-+-+---++

Which as Dan shows, is easier shortened to ...
   <@I. '0'=":example
+-+-+---++---+-+-+---++
|4|0|2 4||0 2|4|0|2 4||
+-+-+---++---+-+-+---++

Hope this helps.../Rob

On 26/06/08 9:54 AM, "Dan Bron" <[EMAIL PROTECTED]> wrote:

> Tracy Harms wrote:
>> > What I want instead of this is a list of boxes. Each box is
>> > to contain the result of I. applied to the corresponding item
>> > of  example . 
> 
> What you want is  <@I. '0'=":example  .  You don't want  &.>  because verbs
> derived from it have rank zero, and  I.  doesn't make
> sense on scalars (  I.  needs to look at a whole list;  I.&.>  can only look
> at an atom at a time).
> 
> The reason  <@I.  works without needing the rank conjunction is because  I.
> is already rank one:
> 
>     I. b. 0
>  1 _ _
>     
> 
> If it weren't, you'd need the rank conjunction.  For example, let's say  I.
> were instead defined with rank infinity:
> 
>     I  =:  I."_
> 
> then you'd need to say something along the lines of  <@:I"1 '0'=":example  .
> Or, say you wanted to take advantage of the special
> code which supports  I.@:=  .  Then you'd need to say  '0' <@:(I.@:=)"1
> example.  
> 
> Does that help?
> 
> -Dan
> 
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to