The name x. (and y.) could refer to a noun or a verb just as x (and y) can,

   incrby=. 1 : 'x i.'
   v=. + *:
   v incrby 6
6 7 10 15 22 31

Tacit adverbial programming has become more difficult over time (and tacit
conjunctional programming has been impossible for a while); however, this
adverb can be made tacit easily,

   incrby=. (`i.) (`:6)

   incrby
(`i.)(`:6)

   v incrby
v i.
   v incrby 6
6 7 10 15 22 31

The complication  (&>)  seems unnecessary, at least for the case at hand.
At any rate, it is not very difficult to make a version of the explicit
adverb,

   incrby=:1 :'(u (&>) i.) y'

tacit,

   incrby=. (`((<;:'&>')`i.)) (`:6)
   v incrby
v&> i.

   v incrby 6
6 7 10 15 22 31

I hope it helps.

PS.  Thanks for sharing the books.google.ca trick


On Fri, May 31, 2019 at 2:41 PM 'robert therriault' via Programming <
[email protected]> wrote:

> Later on in the book (via magic of search of books.google.ca) it looks
> like he has also defined
>
> incrby =. 2 : 'x. ((&>) i.) y.' on page 267
>
> which would be a conjunction but without positions for u or v in the
> expression
>
> Not sure what is going on here, but I can replicate the effect that he was
> going for by defining it as an adverb.
>
>   incrby=. 1 : 'u i.'
>    v=. + *:
>    v incrby 6
> 6 7 10 15 22 31
>
> Cheers, bob
>
> > On May 31, 2019, at 11:05 AM, 'Pascal Jasmin' via Programming <
> [email protected]> wrote:
> >
> > can you tell us what the function is expected to do?
> > &> is an unboxing adverb
> > (a v) is a syntax error.  But perhaps an early version of J, it wasn't.
> >
> >
> >    On Friday, May 31, 2019, 2:00:00 p.m. EDT, Ulrich Vollert <
> [email protected]> wrote:
> >
> > Hello,
> >
> > I am reading „J: The natural language for analytic computing“ and on
> page 47 the author defines an adverb
> >
> >     incrby =: (&>) i.
> >
> > which leads to a syntax error if I try to define it.
> >
> > Any hint what is going on?
> >
> > Regards,
> > Ulrich
> >
>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to