The best technique for avoiding work is to not specify it in the first place.
@. does work, of course. :: is another option. ^: is another option. Often, though, it's better to instead specify an operation which does the right thing instead of "exiting early". The reason for this has to do with the possibility that more work needs to be done elsewhere in the array. Examples of this kind of "exiting early" include adding 0 and multiplying by 1. Actually, it really depends on the kind of problem you are trying to solve. For example, using i. or indexing could also be considered to be a data driven "exiting early" approach. Usually it's best to focus on the practical issue you are trying to address... Thanks, -- Raul On Mon, Aug 25, 2014 at 11:34 PM, William Szuch <[email protected]> wrote: > What techniques or methods can be used to exit a tacit at multiple points > depending on the results of the data flow through the tacit ?. > > In an explicit this is achieved by using the control statement "return." a > multiple times. > > > > A simple case for one exit would be to use something like: > > > > f1`[email protected] > > > > A more generalised situation: > > > > (fn`[email protected])@:.(f2`extit1 @.t1)@: (f1`[email protected]) > > Regards > > > > Bill Szuch > > > > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
