Although I think the approach Dan and Raul are taking is terrifically instructive, the other option I see is to define explicitly
4 : 'x ((x & a) c (y & d ))@:b y' x b y is only calculated once and the original arguments are kept available by reusing the x and y placeholders. Cheers, bob On 2010-09-28, at 2:43 PM, Raul Miller wrote: > On Tue, Sep 28, 2010 at 5:34 PM, Dan Bron <j...@bron.us> wrote: >> (Of course, you don't need an explicit definition for this; you could use >> global named nouns. But local nouns are cleaner for ephemera.) > > More specifically, you can bind the name of the noun to > ". or do, and create a word that updates the name with > new values. > > This can be useful for "almost constants", such as configuration > parameters. > > dim=: ". bind 'configDimensions' > setDim=:1 :'configDimensions=:m' > > -- > 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