[erlang-questions] idea: function meta data

Richard O'Keefe ok@REDACTED
Tue Aug 3 01:13:36 CEST 2010


> 
> On Nov 16, 2007 4:49 AM, Vat Raghavan <machinshin2002@REDACTED> wrote:
>> i REALLY REALLY like the idea of meta doc strings.
>> one possibility for a syntax for it is like pythons', which is something like this ->
>> 
>> def func( bar )
>> """  This is the docstring for this function
>> """
>> and then as someone else said, in the string you can do :
>> 
>> help(Module, func). and the shell emits  ->
>> "This is the docstring for this function"

Lisp-style docstrings do not make sense for a language like
ML or CAML or Clean or Haskell or Mercury or Erlang where a
function (A) may have multiple clauses -- so there is no
obvious unique place to *put* the docstring and (B) normally
use pattern matching -- so the arguments often fail to have
*names* that the docstring can talk about.

We're left with the Quintus Prolog style of documentation
comment, or with EDoc.  Since we already *have* tools for
EDoc, let's stick with that.
>> 
>> 
>> then in the shell
>> help(Module, func).

That should be something like help(Module, Name, Arity)
and there's not the least reason why that couldn't be
driven off EDoc.




More information about the erlang-questions mailing list