In the description of Z:, x refers to the left argument of Z:, not of
any fold it is running in.
Henry Rich
On 8/28/2019 7:43 PM, 'Pascal Jasmin' via Beta wrote:
Thank you Raul, that model is intuitive
([ [ _1 Z: 5 < -) F:. ] p: i.20
3 5 7 11 13 17 19 23
its not obvious why this terminates. _1&Z: description makes reference to x even if it
doesn't exist ("next new value of x" makes no sense if y is the one with items) .
I thought it would do something similar to the following.
([ [ 0 Z: 5 < -) F:. ] p: i.20
3 5 7 11 13 17 19 23 31 41 43 47 61 71
([ [ 0 Z: 5 >: -) F:. ] p: i.20
29 37 53 59 67
On Wednesday, August 28, 2019, 06:07:25 p.m. EDT, Henry Rich
<[email protected]> wrote:
Your imagination about how to use this matches mine.
But please suggest improvements as they occur to you! This is being put
out as a J addon right now, so it will be easy to change as we gain
experience. In a few months, when we deem the design solid, the
implementation will be put into C and frozen there.
Henry Rich
On 8/28/2019 5:59 PM, Raul Miller wrote:
On Tue, Aug 27, 2019 at 10:47 PM 'Pascal Jasmin' via Beta
<[email protected]> wrote:
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
Is this equivalence worth noting?
([ [ _2 Z: 5 < -) F.. ] p: i.20
23
The right argument to Z: is a on/off control value -- 0 means Z: does
nothing that time.
With this fold implementation, I anticipate seeing constructs like:
f [ opcode Z: test
How might you get the first prime whose previous neighbour is less than 5
higher? (29)
Presumably, you were hinting at a variation on this:
([ [ 1 Z: 5 < -) F.. ] p: i.20
29
Thanks,
---
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
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm