Thanks that does the job nicely. I'm not really clear about what it is doing though. Can anyone confirm or correct the following analysis of the sentence: foo=: + 1 : tstr
An adverb is defined by 1 : tstr that combines with the verb to its left + which acts as a sort of identity function returning the tacit sentence defined in tstr as new verb which is then assigned to foo. Is that anywhere close to reality? ---Roger Hui wrote: > tstr=: '(* ,: +)' > foo=: + 1 : tstr > 3 4 5 foo 7 2 4 > 21 8 20 > 10 6 9 > > tstr1 =: '* ,: 2&[EMAIL PROTECTED]' > goo=: + 1 : tstr1 > 3 4 5 goo 7 2 4 > 21 8 20 > 9 4 6 > > > > ----- Original Message ----- > From: "Sherlock, Ric" <[EMAIL PROTECTED]> > Date: Tuesday, November 25, 2008 23:21 > Subject: RE: [Jprogramming] Define tacit verb from string > To: Programming forum <[email protected]> > > > That method seems to work for simple verb trains but not more > > complicated sentences: > > > > tstr =: '* ,: 2&[EMAIL PROTECTED]' > > 3 4 5 (;:tstr)`:6 (7 2 4) > > |domain error > > | 3 4 5 (;:tstr)`:6(7 2 4) > > > > If I rewrite as simple train: > > tstr =: '* ,: 2: + ]' > > 3 4 5 (;:tstr)`:6 (7 2 4) > > 21 8 20 > > 9 4 6 > > > > But that might get a bit unwieldy as the sentence gets more > > complicated. Is there a more general method? > > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
