Note that you quoted this text:
2 ('+/' apply ,) 3
5
;)
Thanks,
--
Raul
On Mon, Apr 7, 2014 at 6:22 PM, Pascal Jasmin <[email protected]>wrote:
> '@u'eval
> @a:
>
> '@u' 1 : ''''' 1 : m'
> @''
>
>
> You are right about it being fairly easy to shoehorn any dyadic verb into
> a modad for apply, but there is a simplicity to eval when a large boxed
> structure made of several variables is the left hand part.
>
> > PPS. For the record: perhaps apply (128!:2) should not produce adverbs
> or
> conjunctions (or verbs); but, it can.
>
> I won't say I don't believe you, but I don't know how. :)
>
>
>
>
>
> ----- Original Message -----
> From: Jose Mario Quintana <[email protected]>
> To: Programming forum <[email protected]>
> Cc:
> Sent: Monday, April 7, 2014 4:32:47 PM
> Subject: Re: [Jprogramming] an improvement to apply and perhaps anon evoke
>
> I have used similar tools for related purposes before; nowadays I use the
> word-from-linear (104!:1) extension. It is not a secret that I have an
> aversion to explicit definitions; one reason is that they change the
> context:
>
> wl=. 104!:1
> eval =: 1 : ' a: 1 : m'
>
> < '@' eval +'/' eval 1 2 3
> ┌─┐
> │6│
> └─┘
> < '@' wl +'/' wl 1 2 3
> ┌─┐
> │6│
> └─┘
>
> So far, so good; however,
>
> @u
> @u
> '@u'wl
> @u
> '@u'eval
> @a:
>
> PS. Apply (128!:2) only can refer to a verb that take a single argument,
> and J verbs can take only one or two arguments. I regard both situations
> as very minor annoyances. It is not difficult to circumvent this
> “limitation” of apply (and, of course, J verbs can take virtually several
> arguments), for example,
>
> 2 ('+/' apply ,) 3
> 5
>
> PPS. For the record: perhaps apply (128!:2) should not produce adverbs or
> conjunctions (or verbs); but, it can.
>
>
>
>
>
>
> On Sat, Apr 5, 2014 at 1:26 PM, Pascal Jasmin <[email protected]
> >wrote:
>
> > apply does not work with dyadic verbs, and cannot produce modifiers.
> > Consider the following simple looking eval function.
> >
> > eval =: 1 : ' a: 1 : m'
> >
> >
> > 2 '+' eval 1 2 3
> > 3 4 5
> >
> >
> > + '/' eval 1 2 3
> > 6
> >
> >
> >
> > '+/' eval(+:@) 1 2 3
> > 12
> >
> >
> > +:@+'/' eval 1 2 3
> > 22
> >
> >
> > +: +'/' eval 1 2 3
> > 12
> >
> >
> > (+: '@' eval +)'/' eval 1 2 3
> >
> > 22
> >
> > +: '@' eval +'/' eval 1 2 3
> > 12
> >
> >
> > The last statement is interesting because it seems to alter the normal
> > conjunction train processing (sometimes in desirable ways)
> >
> > instead of just grabbing a single token as v.
> >
> > < '@' eval +'/' eval 1 2 3 NB. would be domain error without '@'eval
> > ┌─┐
> > │6│
> > └─┘
> >
> >
> > eval is the key to how my multiline tacit code works:
> >
> http://www.jsoftware.com/jwiki/PascalJasmin/Multiline%20tacit%20expressions%20with%20macros
> > ----------------------------------------------------------------------
> > 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
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm