This sounds like a terminated fold.

 Something like
https://wiki.jsoftware.com/wiki/Vocabulary/fcap#How_should_I_define_u_and_v.3F
... maybe 0 ]F..(_2 Z: f@[) coords

(That said, you probably want to restructure your description a bit so
that you can get a useful result from all of this work.)

I hope this helps,

-- 
Raul


On Fri, Oct 21, 2022 at 12:19 PM Ed Gottsman
<edward.j.gotts...@gmail.com> wrote:
>
> Hi.  I’m blanking on something basic and research isn’t helping.  When the 
> blindingly obvious solution is revealed I will blame a combination of sleep 
> deprivation and senescence.
>
> I’ve got a long list of coordinates ordered by desirability.  I want to 
> invoke f (a custom script) with each coordinate in turn.  f may return 0 
> (failure), in which case I want to invoke it again with the next coordinate.  
> When f (eventually) returns 1, I want to terminate—the remainder of the 
> coordinates should not be processed.  (Note that the very first invocation of 
> f may return 1.)
>
> This *almost* feels like ^: in its Do While form.  Almost.  It also feels 
> like SCs around list operations (though they seem to be limited to 
> primitives).
>
> Help.
>
> Many thanks.
>
> Ed
>
> Sent from my iPad
> ----------------------------------------------------------------------
> 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