[Jprogramming] Am I understanding m/y ?
Raul Miller
rauldmiller at gmail.com
Tue Feb 23 05:38:49 UTC 2016
Ok, so we left to right insertion combined with right to left
evaluation. That might be "algorithmically interesting" but it also
seems unnecessarily complex for some useful cases.
Do we have no way of performing the insertion in the same order as the
evaluation order? This would be important in constructing efficient
gerund scans.
And, currently, I'm not seeing any such option - given left to right
insertion, we would need left to right evaluation of the insertion for
an efficient scan.
Argh...
--
Raul
On Mon, Feb 22, 2016 at 11:54 PM, bill lam <bbill.lam at gmail.com> wrote:
> In DOJ, but inside Introduction part
>
> http://www.jsoftware.com/help/dictionary/intro21.htm
>
> to recap,
> x=.4
>
> +`*/1,x,3,x,3,x,1
> 125
> 1 + x * 3 + x * 3 + x * 1
> 125
> 1 * x + 3 * x + 3 * x + 1
> 61
>
>
> Пн, 22 фев 2016, Raul Miller написал(а):
>> http://www.jsoftware.com/help/dictionary/d420.htm says:
>>
>> m/y inserts successive verbs from the gerund m between items of y,
>> extending m cyclically as required. Thus, +`*/i.6 is 0+1*2+3*4+5
>>
>> But it does not include an example of m/y where y contains an odd
>> number of elements.
>>
>> From the description, I would expect +`*/3 4 5 to give the result 3*4+5
>>
>> However:
>> 3*4+5
>> 27
>> +`*/3 4 5
>> 23
>>
>> I'm thinking that this might be a bug in the interpreter.
>>
>> Is there some application, though, that requires the current behavior?
>>
>> Thanks,
>>
>> --
>> Raul
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list