[erlang-questions] edoc, erlc and dialyser type spec consistency

Kenneth Lundin <>
Thu Nov 19 13:02:44 CET 2009


I agree with Kostis answers and can also inform you that we are working
on a solution for a) below.

The plan is:
Edoc will then parse and use the same -spec and -type as Dialyzer.
If a file contains both -spec/-type and edoc comments with @spec and @type
you will have to choose which notation to use (as a compatiblity mode) for
already existing edoc markup.

/Kenneth Erlang/OTP Ericsson

> My suggestion:
>
>    a) There should be ONE type/spec parser as part of the OTP distribution
>       everybody should use this one and not their own
>
>    b) Specs and types must finish with DOT WHITESPACE.
>
>    c) Quoting atoms in type specs is illegal.
>
>    d) Function names are required (ie not optional as in edoc)
>
>    e) Short form of type names are legal
>       bool(), int().
>
> There rules obey certain meta principles:
>
>    meta principle 1) "don't wear your fingers out"
>
>   - I want to type
>
>        foo(X::bool()) -> ok.
>
>    and not
>
>        foo(X::boolean()) -> 'ok'
>
>    meta principle 2) "optional is bad"
>
>        ie DOT whitespace is not optional - dropping the function
>        symbol and inferring it from the next function is bad.
>
>        (aside: the optional ';' in Javascript totally screwed up
>                the parser and is responsible for lager numbers
>                or really weird errors)
>
>    meta principle 3) "make type specs etc look like Erlang"
>
>    Similar syntax if possible, similar conventions. The sudden appearance
>    of quotes, optional '.' violates the principle of least astonishment.
>
>
> /Joe
>
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
>
>


More information about the erlang-questions mailing list