The issue is that } is an adverb.

So, even though V0 } V1 looks like a verb train, it's actually a hook, parsed 
as (V0}) V1 , which doesn't do what you want.

You're looking for (OLD&=)`(,:&NEW) }  .  This is one of my very favorite J 
phrases.

-Dan

 
Please excuse typos; composed on a handheld device.

-----Original Message-----
From: "Shaw, Ewart" <ewart.s...@warwick.ac.uk>
Sender: programming-boun...@jsoftware.com
Date: Wed, 14 Dec 2011 11:41:41 
To: <programming@jsoftware.com>
Reply-To: Programming forum <programming@jsoftware.com>
Cc: Shaw, Ewart<ewart.s...@warwick.ac.uk>
Subject: [Jprogramming] Problem with }

I'm trying to recode data using  (=&OLD } ,:&NEW) 
but the following happens both on J7 and J64-602:

   (3 1 4 1 5 9 = 1) } 3 1 4 1 5 9,:_1   NB. OK
3 _1 4 _1 5 9
   (=&1 } ,:&_1) 3 1 4 1 5 9             NB. not OK
 9  1  4  1  5  9
_1 _1 _1 _1 _1 _1
   A=. (=&1 ; ,:&_1) 3 1 4 1 5 9         NB. check args of }
   B=. (3 1 4 1 5 9 = 1) ; 3 1 4 1 5 9,:_1
   A-:B
1

Any suggestions? (I might be missing something obvious
as I've spent much of the night analysing a clinical trial!)

Many thanks, Ewart Shaw

J.E.H.Shaw      http://www.warwick.ac.uk/statsdept 

----------------------------------------------------------------------
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