"
   NB.the parsing rule is a little odd.
   NB.Using a one liner without defining l gives syntax error.
"

This one seems to work:

in_z_=:2 : '(u`'''' (,&(,&''_''@:,@:>)) n)~'


On Sun, Apr 23, 2017 at 8:54 PM, Xiao-Yong Jin <[email protected]>
wrote:

> Right.  I consolidated it to a simple conjuction `in`
>
> in_z_=:2 :0  NB.accepts global named verb
>   l=.,&(,&'_'@:,@:>)
>    NB.the parsing rule is a little odd.
>    NB.Using a one liner without defining l gives syntax error.
>   (u`'' l n)~
> )
>
> c=:0
> t=:3 :0
>   c + y
> )
> a=:1 :0
>   echo u`''
>   u y
> )
> f=:3 :0
>   C=.conew'base'
>   c__C=:2
>   z=.(t in C a;*:@(t in C)a) 0
>   codestroy__C''
>   z
> )
>
> > On Apr 23, 2017, at 2:31 PM, 'Pascal Jasmin' via Programming <
> [email protected]> wrote:
> >
> > I gave the needed solution earlier.
> >
> > f. doesn't help with explicit verbs that have locale references or side
> effects.
> >
> >
> >
> >
> > ________________________________
> > From: roger stokes <[email protected]>
> > To: [email protected]
> > Sent: Sunday, April 23, 2017 1:37 PM
> > Subject: [Jprogramming] how do you pass a verb with a named object local
> to    an adverb?
> >
> >
> >
> >   NB. Suppose we have:
> >
> >
> >
> > verbInClass_SomeClass_ =: plus
> >
> >
> > plus_SomeClass_ =: +
> >
> >
> > adv =: /
> >
> >
> >
> > NB. then how about this ?
> >
> >
> >
> > f =: 3 : 0
> >
> >
> > s =. coname ''                    NB. save current locale
> >
> >
> > C =. conew 'SomeClass'
> >
> >
> > cocurrent > C
> >
> >
> > v =. verbInClass f.
> >
> >
> > cocurrent > s                     NB. restore current locale
> >
> >
> > v adv y
> >
> >
> > )
> >
> >
> >
> > f 1 2 3
> >
> >
> > 6
> >
> > ----------------------------------------------------------------------
> >
> > 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

Reply via email to