Obscure point of interest: m does not have to be a noun. It can be a verb, as in x _1:} y , which takes an atom x and places it at the last index of the /ravel/ of y.
That is, the verb f in f} addresses y as a flat list. If course, that doesn't change the shape of the result, f} is still an amendment that only effects value, not structure. The verb} case is documented in the Vocabulary, but the documentation a buggy: it doesn't mention the "indexes the ravel" aspect of the implementation. -Dan Please excuse typos; sent from a phone. > On Jul 5, 2014, at 6:27 PM, "'Pascal Jasmin' via Programming" > <[email protected]> wrote: > > Its not quite the case that it has to be a constant, but it does have to be a > noun. > > this conjunction is useful for tacit code and dyadic adverbs that take noun > arguments: > > eval =: 1 : ' a: 1 : m' > advswap =: 2 : (':';'u x v eval y') > > 1 2 3 ([ 13 advswap '}' ]) i.10 > 0 13 13 13 4 5 6 7 8 9 > > does constant replacement instead of constant index > > > ----- Original Message ----- > From: Erling Hellenäs <[email protected]> > To: [email protected] > Cc: > Sent: Saturday, July 5, 2014 3:59:22 PM > Subject: [Jprogramming] Tacit J and indexed replacement > > Hi all ! > > When you write tacit code, the index m used by Amend, syntax > description x m} y, is a constant? > Normally you have a variable you want to use for indexing? This means > Amend is seldom useful for indexed replacement when you write tacit J? > Are there any descriptions of nice ways to do indexed replacement in > tacit J? > As with Amend, the result has to be a new variable, of course. > > Cheers, > > Erling Hellenäs > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
