Certainly. And you can also use ([+]) or even + if what you want to do is add numbers.
Also, using [ and ] in forks covers a lot of the ground covered by lambdas (albeit in a more constrained fashion). Thanks, -- Raul -- Raul On Mon, Feb 2, 2015 at 10:23 AM, Aai <[email protected]> wrote: > Single line: > > 3 :'(x+y)[''x y''=.y' 1 2 > > > Raul Miller schreef op 02-02-15 om 16:17: >> >> Oops, good point - I had a typographical error there. My apologies for >> not thinking this through. >> >> Here's a fixed version, with example arguments. >> >> (3 :0) 2 3 >> 'x y'=. y >> x + y >> ) >> 5 >> >> Multi-line statements, like this one, tend to be clumsy, >> interactively, but that does not mean that they do not work. >> >> You could use ('x y')=. y but those parenthesis serve no mechanical >> purpose. (The parenthesized form is to force J to use a variable's >> value rather than its name, and that's not relevant here, especially >> since x is undefined and y is a noun.) If you like the emphasis they >> confer, you can include them - but you also need the quotes. >> >> Thanks, >> > > -- > Met vriendelijke groet, > @@i = Arie Groeneveld > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
