Andrew Nikitin wrote:
> 
> 
> 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.
> 
Maybe this is because of all the cruft: 3 : '  and  the closing ' look ugly.
In multiline definitions the cruft is less apparent and the likelihood of 
using, at least in part, of tacit expressions increased.

To me the main problem with explicit definitions is that 
they are always first and foremost strings (or as it is often said,
scripts).  
You can define:

  smiley =: 1 : ':-)"

and the interpreter will dutifully record your request and everything is 
fine because nothing in particular is done but an arbitrary string 
turned into something seemingly meaningful by attaching an attribute
to it.

Tacit expressions are more alive: as soon as you define one,
it gets evaluated and you get something back that is valid,
i.e either noun, verb or adverb, or an error.  In fact the only
way something may go wrong in this sense is if your tacit 
definition involves implicitly some implicit definitions.



> This and only this fuels myth of alleged superiority of purely tacit
> expressions.
> Because ugly cannot be good.
> 
Having said all this, if I know that v is a vector, I'd always prefer to use

  %: +/ *: v

to calculate its norm at spot, or in script for that matter.  If v, however, 
happens to be a list of vectors, tacit again helps since we don't have 
to define any verb to get norms of individual vectors:

  %:@:(+/)@:*:"1 v

I prefer tacit also because it makes me think about thinking algebraically 
about programs, and desire to turn everything into tacit gets us faster
to novel ways of writing programs winding towards the limits 
of the language.

-- 
View this message in context: 
http://old.nabble.com/Tacit-exercise-tp26860170s24193p26860749.html
Sent from the J Programming mailing list archive at Nabble.com.

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

Reply via email to