So, that is what I was missing.  It seems that one can literally fix the
problem of passing named verbs (at least it works for simple examples);
make the wrapper,


qromb=. 1 : 0   NB. Base wrapper
  qromb_nr_ (u f.`'') ; y
)

   square=. *:

   square qromb 1 2
2.33333333

   square=. 3 : ' *: y'

   square qromb 1 2
2.33333333

Regarding "calling qromb inside of qromb" and "the current code can't deal
with this kind of recursion" you are referring to the code I provided not
the method for trying to integrate.  Right?  I ask because the thread
subject suggest to me that adverbs and conjunctions present a problem that
verbs do not.  However,  qromb_nr_  is a verb; maybe there would be a
problem with the wrapper? I do not know (as I said know very little about
explicit programming).




On Wed, Apr 5, 2017 at 5:57 PM, Xiao-Yong Jin <jinxiaoy...@gmail.com> wrote:

>
> > On Apr 5, 2017, at 4:33 PM, Jose Mario Quintana <
> jose.mario.quint...@gmail.com> wrote:
> >
> >   *: qromb 1 2
> > 2.33333
> >
> >   ((*: qromb 1 2) * *:) qromb 1 2
> > 5.44444
> >
> >   coname''
> > ┌────┐
> > │base│
> > └────┘
> >
> >
> > I must have missed something.
> >
> Try pass in a named verb.
>
> And when I said calling qromb inside of qromb, I wanted to do a 2D
> integration.
> So an integration of the function x*y with x from 0 to 1 and y from 0 to 1
> can be
>    f=:3 :'*&y qromb 0 1'    NB.integrate over x given y
>    f qromb 0 1              NB.integrate over y
> One should expect the result being 0.25, but don't try this.
> The current code can't deal with this kind of recursion.
> ----------------------------------------------------------------------
> 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