> Van: [EMAIL PROTECTED] [mailto:programming-
> [EMAIL PROTECTED] Namens Raul Miller
> Verzonden: dinsdag 5 februari 2008 13:48
> Aan: Programming forum
> Onderwerp: Re: [Jprogramming] Figuring out sums and differences (is it
> reallythis simple?)
> 
(...)
> I think you should read the definitions of @  @:  and [:
> 
> But, basically,
> 
>    [: u v
> and
>    u @: v
> mean the same thing
> 
> Also,
>    u @ v
> means the same thing as
>    u @: v "v
> 
> Note that v " v is shorthand for v " (v b. 0)
> 

Another approach is the following.

A verb v produces chunks of data which sometimes are glued together using
fills. An example will clarify this.

Let i0=: i."0 then

   i0 2 3 4
0 1 0 0
0 1 2 0
0 1 2 3

whereas 

   (i0 2);(i0 3);i0 4
+---+-----+-------+
|0 1|0 1 2|0 1 2 3|
+---+-----+-------+

So i0 is applied to each of the numbers of its right argument y and each of
that outputs do have different shape - see inside the boxes - and these
outputs are reshaped with fills - 0 in this case - to make one, decent noun.

The difference between @ and @: is given by

   <@:i0 2 3 4
+-------+
|0 1 0 0|
|0 1 2 0|
|0 1 2 3|
+-------+

   <@i0 2 3 4
+---+-----+-------+
|0 1|0 1 2|0 1 2 3|
+---+-----+-------+

So @: is applied after the glueing is done, @ is applied before the glueing
is done.

Using <@ or <@: teaches you a lot about the difference.


R.E. Boss



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

Reply via email to