[Jprogramming] Tacit adverb definitions?
Oleg Kobchenko
olegykj at yahoo.com
Fri Jul 7 04:05:17 HKT 2006
Very creative! Is there a precedent of such
use of $: and : ?
Other possibilities
+ (1 $: ] : ) 2 NB. m&v
3
- (3 $:~ ] : ) 2 NB. u&n
_1
----- Original Message ----
From: Dan Bron <jf at dbron.net>
To: Programming forum <programming at jsoftware.com>
Sent: Thursday, July 6, 2006 2:22:19 PM
Subject: RE: [Jprogramming] Tacit adverb definitions?
> o =: 1 : '{.u{:'
> Is there a corresponding tacit definition?
Thinking about it more, I would write this as:
o =. {. $: {: :
Which is tacit and superior to 1 : '{. u {:' :
2 + o 3
5
+ o 2 3
5
But if you can ensure that you're never called dyadically, and that monadic arguments are of length 2 , then write:
o =. / NB. :)
-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list