I said:
>  I'm seeking a stylish workaround to the a constraint on applications of
>  ^:_  .

Raul responded:
>  Construct iteration arguments as a list and use / to iterate.

I agree this is a useful idiom, if your problem can be rephrased this way. 
However, only algorithms that have a fixed number of iterations are
amenable to such rephrasing, unless you can correct me.  This algorithm is
nondeterministic and so cannot be phrased in terms of a fixed number of
iterations:

>  Include a "generation counter" in your domain (or perhaps a bit
>  which you always invert).

Yes, I already considered this approach:

> that is, concatenating a boolean and negating it every iteration

In fact, it is the one I adopted.  However, I do not consider it "stylish". 

Jose wrote:
> this is what I currently use instead of U^:V^:_ in similar situations:

I have to study this "while" -- at first glance, it seems to be more
complicated than neccesary.  Can you explain its operation at a high level?

>  For recursive alternatives to u while v see 
>  http://www.jsoftware.com/pipermail/general/2005-July/023272.html
>   evolve=. ]`([ $: f)@.done

I avoid recursion in J if I can; it's unreliable (because the language
doesn't optimize tail calls, it has a low, artificial, compiler-imposed
limit on stack depth).

> I guess Dan really meant:

Yep, you got it.

-Dan

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to