-:&(1&o.)&+:d. 1 NB. This work-around works 2"0 * (1r2"0 * 2&o.)@+:
There are limitations in the implementation of d. . (I wouldn't call it an error). -:&(1&o.)&+:d._1 NB. J even performs integration! %&2x@(-:@(-@(2&o.))@+:) --- Den lør 20/11/10 skrev Marshall Lochbaum <[email protected]>: > Fra: Marshall Lochbaum <[email protected]> > Emne: Re: [Jprogramming] Accessing a verb as thecomposition ofits"primitives" > Til: "'Programming forum'" <[email protected]> > Dato: lørdag 20. november 2010 04.13 > Doesn't look like it: > > 1&o.&.:+: d. 1 > |domain error > | 1&o.&.:+:d.1 > > This seems like a rather glaring error. Shouldn't it be > relatively simple to > replace a sentence with &. or &.: with one using > only composition and > inverses? > > Marshall > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] > On Behalf Of Dan Bron > Sent: Friday, November 19, 2010 8:04 PM > To: J Programming > Subject: Re: [Jprogramming] Accessing a verb as > thecomposition > ofits"primitives" > > Bo Jacoby & Marshall Lochbaum wrote: > > 1&o.&.:+: NB. > mathematical equivalence > > Ok, you guys win. :) > > -Dan > > PS: Does d. work with &. or &.: ? > > > Please excuse typos; composed on a handheld device. > > -----Original Message----- > From: Marshall Lochbaum <[email protected]> > Sender: [email protected] > Date: Fri, 19 Nov 2010 19:27:58 > To: 'Programming forum'<[email protected]> > Reply-To: Programming forum <[email protected]> > Subject: Re: [Jprogramming] Accessing a verb as the > composition > ofits"primitives" > > How about > 1&o.&.:+: > ? > > (Okay, I cheated. This is mathematical, not semantic, > equivalence. But I > like it anyway.) > > Marshall > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] > On Behalf Of Dan Bron > Sent: Friday, November 19, 2010 6:27 PM > To: J Programming > Subject: Re: [Jprogramming] Accessing a verb as the > composition > ofits"primitives" > > Bingo. > > Or, to put it another way, > > (1&o. * 2&o.) d. 1 > and > sincos d. 1 > > mean the same thing, because > (1&o. * 2&o.) > and > sincos > mean the same thing. As proof, try sincos d.1 > f. instead of sincos f. d. > 1 . > > -Dan > > > PS: of course if you're treating sincos vs (1&o. * > 2.&o.) textually or > grammatically, they look different; I'm just talking about > syntactic > equivalence here. > > > BTW, 1 2 */ .(o./) ] is a fun semantic equivalent to > sincos (which is > different from syntactic equivalence! eg d. won't > work). Can anyone make > that cuter? > > > > Please excuse typos; composed on a handheld device. > > -----Original Message----- > From: "Sherlock, Ric" <[email protected]> > Sender: [email protected] > Date: Sat, 20 Nov 2010 11:56:26 > To: Programming forum<[email protected]> > Reply-To: Programming forum <[email protected]> > Subject: Re: [Jprogramming] Accessing a verb as the > composition of > its"primitives" > > There may be there is some confusion here. > > What Dan is saying is that the following two lines give the > same result > (which they do for me): > (1&o. * 2&o.) d. 1 ] 0.4 > 0.69670671 > sincos d. 1 ] 0.4 > 0.69670671 > > In other words the derivative of sincos is correctly taken > when sincos d. 1 > is applied to arguments, it just doesn't "show" the > algebraic solution when > entered without arguments. If you want that then use f. as > Raul suggests. > > > > From: Alex Gian > > Sent: Saturday, 20 November 2010 11:33 > > > > Not on any of the J systems I've tried! > (Including Linux, > > Win32(Wine), or Windows Mobile / PPC) > > > > I thought it was just a weird peculiarity of J, > obviously d. "should" > > work on a user defined verb if it can. > > > > I tried with other verbs, like p. too, just in case o. > was causing the > > problem. Nope, once you define a verb in terms > of its primitives d. > > don't work no more. Just FYI > > > > On Fri, 2010-11-19 at 21:58 +0000, Dan Bron wrote: > > > Raul is right, but just to be clear, when applied > to arguments, > > > sincos d. 1 > > and sincos f. d. 1 will have identical > results*. Just type into the > > IJX without arguments, the latter looks different from > the former for > > exactly the same reason sincos f. looks > different from sincos . > > > > > > That is, f. explicitly requests its argument be > exploded into its > > > components > > (but again, the argument to f. applied to its own > arguments will havbe > > the same results, exploded or not - that's the point > of naming stuff - > > subordinating detail / hiding complexity). > > > > > > -Dan > > > > > > * I haven't tested this, but if it isn't true, > that's an interpreter > bug. > > > > > > > > > > > > > > > Please excuse typos; composed on a handheld > device. > > > > > > > ---------------------------------------------------------------------- > > 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 > ---------------------------------------------------------------------- > 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
