Bob Therriault wrote:
> using ("_) ... was unexpected
> and enlightening.
Yes, ("_) is neat, as is its "inverse" (reverse? obverse? counterpart),
(`'') . Want to see something else fun?
OK, first take:
av2t2 =: ("_) (`*) (`(-~)) (`:6)
then try:
3 av2t2
3"_ * -~
and study the result. Now, let's introduce a little something extra:
Nar =: (`(<;~nn)) (<@:;~&(nn=.":noun)`))
av2t4 =: ("_) Nar (`:6) (`*) (`(-~)) (`:6) NB. Nar (`:6)
was inserted
now try it again and compare the result:
3 av2t4
3 * -~
Puzzle: where did the "_ go? (Yes, it was still used, but for a
different purpose :)
Sometimes I struggle with the question of whether I want the tacit adverb to
be as simple and elegant as possible, as with av2t2, or whether I want its
result as simple and elegant as possible (at the cost of some complexity in
the adverb) as with av2t4 . I usually decide on the former, since often the
product of the adverb goes uninspected (textually). After all, that's the
point of having a reusable piece of code, right?
-Dan
PS: On my Christmas list is a tacit adverb like Nar but more elegant and
parsimonious (and, ideally, parameterizable to produce other parts of
speech). Anyone feel like Santa?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm