Nicholas Spies wrote:
>    inc =: 4 : '(>: x.{y.) x.}y.'
>    dec =: 4 : '(<: x.{y.) x.}y.'
> It would be interesting (at least for me) to know how one 
> would define this tacitly...

Here's a literal translation to tacit form

incTacit=: ([:>:{)`[`]}
decTacit=: ([:<:{)`[`]}

Unfortunately, the 13 : translator doesn't support this.

> In fumbling around with this, I discovered that it is indeed 
> possible to define functions within a function definition. 

Yes.  Any context capable of defining names is capable of
defining names of any type -- noun, verb, adverb, conjunction.

> The question is, is this kosher (as it is, say, in Pascal)? 

Yes.  However, unlike Pascal, names in these definitions do 
not gain any special relationship with values in the defining 
context.  The standard rules for locals and locales apply.

-- 
Raul

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to