Hi. I actually saw the replies from Henry, Bjorn and R.E.Boss ... but I'm replying here since what Raul was describing is what I actually initially did. I figured that I just assign them to "inline" variables and I got something similar to your example. It's sort of ugly since I know that there is a better way to do it.
Most of the times its frustrating doing tacit programming since I know how to do it if I break it down into its individual parts. Its when assembling them into one line and trying to apply the code into an array is where I always gets bewildered. Thanks anyway ... I'll play around with this tomorrow. I'm going home ... on a BUS ... since my wife won't let me near my Kawasaki ZZR ... huhuhu. r/Alex -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Raul Miller Sent: Wednesday, October 22, 2008 8:07 PM To: Programming forum Subject: Re: [Jprogramming] converting to tacit On Wed, Oct 22, 2008 at 8:04 AM, Alex Rufon <[EMAIL PROTECTED]> wrote: > So how would you convert this to a one line or tacit definition? You can put this all on one line by stringing the lines together. Most of them work "as is", but your final line needs to be re-arranged slightly (using parenthesis and ~). (,csump),.~dper=.2{."1 temp#~#"1 csump=. 2}."1 temp=.i.2 5 0 1 2 0 1 3 0 1 4 5 6 7 5 6 8 5 6 9 You can convert this to a tacit definition by replacing temp with y and wrapping the resulting expression in 13 :''. Or, at least, that should work (sometimes we find bugs in 13 :) And if you have your J session configured to give you linear representation of non-noun results then you should be able to read the resulting verb: 13 :'(,csump),.~dper=.2{."1 y#~#"1 csump=. 2}."1 y' (2 }."1 ]) (([: , [) ,.~ ]) ] (2 {."1 [ #~ #"1) 2 }."1 ] Unfortunately, this is one of the cases where 13 : does not work: (13 :'(,csump),.~dper=.2{."1 y#~#"1 csump=. 2}."1 y')i.2 5 |length error So here's a manual transliteration: (] (,@] ,.~ 2 {."1 (#~ #"1)) 2&}."1) i.2 5 0 1 2 0 1 3 0 1 4 5 6 7 5 6 8 5 6 9 And here's a slightly simpler approach 2 ({."1 ,/@:(,"1 0) }."1)i.2 5 0 1 2 0 1 3 0 1 4 5 6 7 5 6 8 5 6 9 -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
