[erlang-questions] Style wars: junk comments

Richard O'Keefe <>
Mon Sep 17 00:26:27 CEST 2012


On 17/09/2012, at 7:12 AM, Steve Davis wrote:

> Since you can invent attributes, I have played with:
> 
> -api({{Name, Arity}, "Short Descriptive Usage Comment"}).
> 
> ...as a means of compiling brief module self-documention that is visible in X:module_info(attributes).

That's a nice one.  Except that I hate 'api'.  It is still defined as
"Application Programming Interface" and is the interface presented by
a library layer such as an operating system or the X11 window system
to application programs.  Some people started using it to mean
"function" apparently because "function" had too few syllables.
How about "purpose" (two syllables instead of three) or even "for" (one)?

EEP 24 suggested allowing Name/Arity anywhere in any attribute.

-for({foo/1, "listing clowns"}).
-for({bar/2, "telling a clown what routine to use"}).
-for({ugh/3, "advising a clown which way to run and how fast"}).

That EEP has R12B-5 written beside it, so it _should_ work... 




More information about the erlang-questions mailing list