There is syntactic sugar.

    fn =: 3 :

    length =: '%: +/ *: y' fn

I like this because it reminds me of expressions like "the e-to-the-2x 
function" 
( '^ 2*y' fn ), but sweetness is in the tongue of the taster!


Roger Hui wrote:
> Dyalog APL did not assign function (and operator) meanings 
> to { and }.  Instead, you can do the equivalent of
> 
> length=: {%:+/*:y}
> 
> To do the same in J we'd need (at the very least) 
> to find a pair of "enclosing" symbols.  To get rid of
> the quotes we'd need something stronger.  (Special
> parser rules.)
> 
>> ugly cannot be good
> 
> Beauty is in the eye of the beholder.
> 
> 
> 
> ----- Original Message -----
> From: Andrew Nikitin <[email protected]>
> Date: Saturday, December 19, 2009 17:09
> Subject: [Jprogramming]  Tacit exercise
> To: J programming <[email protected]>
> 
>> I think the reason that so many people dislike explicit 
>> definitions is because they are syntactically ugly. Multiline is 
>> only mildly ugly, but single line is a freak. Come on,
>>
>> length=:3 : '%: +/ *: y' ?
>>
>> Bleah. Clean, easy to read and still bleah.
>>
>> This and only this fuels myth of alleged superiority of purely 
>> tacit expressions.
>> Because ugly cannot be good.
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to