Thank you John,
SIDE=:4 : 'x. `:6 &. >y.'"0
is indeed a cleaner and faster version of the verb.
With a great added bonus of working with a single
boxed noun as a common argument to the gerund.
I'm so far unable to see how to clean up AND. I can
think of beheading recursively, but that is also a
multi-liner
--- John Randall <[EMAIL PROTECTED]>
wrote:
> p j wrote:
> > There's probably another name for this, but
> inspired
> > from python terminolgy, a generator form of a
> function
> > is one that is recursively called, but doesn't
> > internally determine when to stop recursing. In
> > Python and other languages, generators produce a
> lazy
> > stream of values, where a "coroutine" will tell it
> > when to stop. In J, a generator form is just a
> verb
> > that returns the input for its next iteration.
> >
>
> This seems a useful idea. I think you can simplify
> your verbs, though.
>
>
> > Look at the SIDE verb (which could be useful as an
> > Evoke Gerund built in option). SIDE takes a
> gerund
> > left argument and boxed right arguments and
> returns a
> > boxed list of the same shape as y, the result of
> x0
> > y0 ; x1 y1 ; ... xn yn (where x0, x1,... xn are
> verbs)
> >
> > SIDE =: 4 : 0
> > a=. 0$0
> > for_i. i.(#x.) do.
> > a=. a , ((i_index{x.)`: 6) &.> i_index{y.
> > end.
> > )
> >
>
> How about
>
> side=:4 : '<x `:6 >y'"0
>
> >:`<: side 1;2
> +-+-+
> |2|1|
> +-+-+
>
> For your AND verb, you probably want to use prefixes
> and the power operator.
>
> Best wishes,
>
> John
>
> >
>
>
----------------------------------------------------------------------
> For information about J forums see
> http://www.jsoftware.com/forums.htm
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm