Also see, http://www.jsoftware.com/help/jforc/writing_your_own_modifiers.htm

On Fri, Oct 5, 2012 at 12:16 PM, Linda Alvord <lindaalv...@verizon.net>wrote:

> Henry Rich (10/4/2012)
>
> ifany=: ^:(*@#@])
>
> Linda
>
> -----Original Message-----
> From: programming-boun...@forums.jsoftware.com [mailto:
> programming-boun...@forums.jsoftware.com] On Behalf Of Lippu Esa
> Sent: Friday, October 05, 2012 11:38 AM
> TKo: 'programm...@jsoftware.com'
> Subject: Re: [Jprogramming] Why the length error?
>
> Hi Rick,
>
> sorry about the dumb question: where is ifany defined?
>
> BTW - I came up with the exactly same solution as you.
>
> Esa
>
> -----Original Message-----
> From: programming-boun...@forums.jsoftware.com [mailto:
> programming-boun...@forums.jsoftware.com] On Behalf Of Ric Sherlock
> Sent: 5. lokakuuta 2012 5:49
> To: programm...@jsoftware.com
> Subject: Re: [Jprogramming] Why the length error?
>
> Raul has already shown how to use under but here is my original one using
> it too:
>    rad=: (#~ [: -. 0 , 2 -:/\ ])&.|: :: ]
>
> However I like the ifany approach better in this case
>    rad=: (#~ [: -. 0 , 2 -:/\ ])&.|: ifany
>    rad B
>
> The reason that ( ifany B ) gives a syntax error is because ifany is an
> adverb not a verb and therefore expects a verb to its left.
>    type 'ifany'
> ┌──────┐
> │adverb│
> └──────┘
>
> You will get the same error if you execute ( / B )
>
>
> On Fri, Oct 5, 2012 at 12:44 PM, Linda Alvord <lindaalv...@verizon.net>
> wrote:
> >
> > Ric,  Is there a way to modify your function so the result of  rad B
> > will
> > be:
> >
> > 3 5 4
> > 2 1 6
> >
> > Linda
> ----------------------------------------------------------------------
> 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
>



-- 
Ken Lettow
Director of Market Intelligence & Web Analytics
ThomasNet
(212) 290-8713
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to