There is no bug.  The forms m...@.n and m...@.v are fundamentally 
different.  In particular, m...@.v y is not the same as m...@.(v y) y .



----- Original Message -----
From: Dan Bron <j...@bron.us>
Date: Thursday, November 19, 2009 7:35
Subject: Re: [Jprogramming] Wrong agenda?
To: Programming forum <programming@jsoftware.com>

> Pepe wrote:
> > What is wrong with the agenda in the last line?
> >    (-`%)@.((0 1)"_) 1 2 3 4 5
> > |rank error
> 
> Nothing wrong with the expression; the interpreter has a 
> bug.  
> 
> I guess few people use verbal agenda to construct trains, so 
> this hasn't
> been caught before.  Most often agenda is used to select a 
> single verb
> from the agenda, so agenda expects the verb to return a scalar.
> 
> I tried a workaround.  I boxed the list so that the verb 
> returns a scalar,
> which should have no effect on the train produced (the box would
> theoretically just put a pair of parens around the train):
> 
>            (-
> `%)@.((<0 1)"_) 1 2 3 4 5
>       |length error
>       |       (-`%)@.((<0 1)"_)1 2 3 
> 4 5
>            
> 
> but no joy.
> 
> -Dan
> 
> 
> ----- Original Message ---------------
> 
> Subject: Re: [Jprogramming] Wrong agenda?
>    From: Don Guinn <dongu...@gmail.com>
>    Date: Thu, 19 Nov 2009 07:47:05 -0700
>      To: Programming forum 
> <programming@jsoftware.com>
> Added parens to make the rank apply to the entire expression.
> 
>    ((-`%)@.((0 1))"_) 1 2 3 4 5
> 0 1.5 2.66667 3.75 4.8
> 
>  Is this what you wanted?
> 
> On Thu, Nov 19, 2009 at 7:07 AM, Jose Mario Quintana <
> josemarioquint...@2bestsystems.com> wrote:
> 
> > What is wrong with the agenda in the last line?
> >
> >    (- %) 1 2 3 4 5
> > 0 1.5 2.66666667 3.75 4.8
> >
> >    (-`%)@.(0 1) 1 2 3 4 5
> > 0 1.5 2.66666667 3.75 4.8
> >
> >    (-`%)@.((0 1)"_) 1 2 3 4 5
> > |rank error
> > |       (-`%)@.((0 1)"_)1 2 3 4 5
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to