On Fri, Nov 18, 2011 at 4:15 PM, Raul Miller <[email protected]> wrote:
> Technically speaking, this is about insert rather than key.

Yep, true.

> It's often the case that  a F b and  F/ a,:b give the same results.

I just found the f//./ usage a little opaque when I first came across
it (probably just because it was a little difficult to visually parse)
and thought it might be nice to see the identity discussed in the
examples section on this wiki page.

Best,
M

> (There are some cases where the result would be different for a generic F
> but which are the same for a specific F, but these are cases where the
> specific F that gives the same results is ignoring the difference in the
> arguments.)
>
> --
> Raul
>
> On Fri, Nov 18, 2011 at 6:10 AM, Marc Simpson <[email protected]> wrote:
>
>> Hi all,
>>
>> Reading through Roger's essay on the key adverb
>> (http://www.jsoftware.com/jwiki/Essays/Key), I thought it might be
>> useful to add a demonstration of the f//./ usage (found, for example
>> in Eugene McDonnell's discussion in "At Work and Play in the Fields of
>> J", http://www.jsoftware.com/papers/eem/AWPFJ/10.htm)?
>>
>> Recreating the data in the current example,
>>
>>   y =. 6 5 9 2 4 9 0 7 0 4 6 8 3 8 1 2 8 0 0 2
>>   a =. 4.6 5.5 7.9 5.2 5.4 3.9 6 5.7 6 9.4 4.6 7.8 1.3 1.8 5.1 9.2 7.8 6 9
>> 6.2
>>
>> the following equivalences could be demonstrated,
>>
>>   (~.y) ,: y +//. a
>>  6   5    9    2    4  0   7    8   3   1
>> 9.2 5.5 11.8 20.6 14.8 27 5.7 17.4 1.3 5.1
>>   (~.y) ,: +//./ y,:a
>>  6   5    9    2    4  0   7    8   3   1
>> 9.2 5.5 11.8 20.6 14.8 27 5.7 17.4 1.3 5.1
>>
>> and perhaps broken down a little (without the nub of y lamination) to
>> show what's going on more clearly:
>>
>>   y +//. a
>> 9.2 5.5 11.8 20.6 14.8 27 5.7 17.4 1.3 5.1
>>   +//./ y,:a
>> 9.2 5.5 11.8 20.6 14.8 27 5.7 17.4 1.3 5.1
>>
>> It might also be worth pointing out that f//./ is handy when you have
>> a matrix rather than two vectors.
>>
>> Best,
>> M
>> ----------------------------------------------------------------------
>> 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

Reply via email to