I wrote:
>  ... ,&":&.> ...

REB wrote:
>  I would prefer
>  ... (,~ ":)&.> ...

I actually considered this as I wrote the line, and decided   &":   was more 
elegant.  My reasoning was along the same lines that
]   can be considered elegant.  In  literal ,&": numeric  the format is applied 
to both arguments equally; neither is treated
"specially", and  ":  is defined such that for literal values it acts like  ]  
.  That is, I'm leveraging a useful feature of  ":
in order to avoid special handling; these my code shorter, cleaner, and more 
fluent.

Anyway, my main motivation was to avoid the extra pair of parens.  I find 
scanning J code becomes slower for every extra set of
parens, particularly nested parens.  Not to say I gave this line a lot of 
consideration; these were just idle, half-heard thoughts
as I typed my way from the right to the left.  I've definitely used the  (,~ 
":)   idiom before and I agree it can draw the reader's
attention to the differences between the left and right arguments, if that's 
what you want him to focus on.

-Dan



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

Reply via email to