some observations,
the x parameter is very powerful because it can be of different shape than
items of y.
"u/ y is equivalent to u F.: ] y"
it appears that more generally, v@u/ y is equivalent to u F.: v y
[`(_2 Z: 1:)@.(5 < -) F:. {: p: i.20
3 5 7 11 13 17 19 23
This makes all of the definitions/cases of Z: more useful, but initial
description can lead the reader to assume v@:(u/) is the equivalent.
Could z: be used in 2&(u//) to break when something is found or is special code
for 2&(1 i.~ u//) all that is needed?
On Tuesday, August 27, 2019, 11:06:48 p.m. EDT, Henry Rich
<[email protected]> wrote:
Documentation is in the works.
Z: can be called from v if you like.
_1&Z: makes sense if the computation that follows it is costly.
Henry Rich
On 8/27/2019 10:42 PM, 'Pascal Jasmin' via Beta wrote:
> documentation needs a lot of attention.
> https://code.jsoftware.com/wiki/System/Interpreter/Requests#Fold_.28strawman.29
>
>
> I think all references for Z: should refer to u verb? Would Z: ever be
> called in v verb? _1&Z: makes no sense.
> As a simple example, find first prime whose next prime is greater than 5
> higher?
>
> [`(_2 Z: 1:)@.(5 < -) F.. ] p: i.20
>
> 23
>
>
>
> [`(_2 Z: 1:)@.(5 < -) F:. ] p: i.20 NB. multiple version that builds list
> and stops on condition.
>
> 3 5 7 11 13 17 19 23
>
> How might you get the first prime whose previous neighbour is less than 5
> higher? (29)
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
---
This email has been checked for viruses by AVG.
https://www.avg.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm