[erlang-questions] Function Spec Syntax

Kostis Sagonas kostis@REDACTED
Tue Nov 11 09:12:22 CET 2008

David Mercer wrote:
> Out of curiosity, should I be using edoc @spec syntax, Dialyzer –spec 
> syntax, or both in my modules?

The answer depends on what you want to do.

If you need to generate documentation for your code now, your only 
option is to use edoc specs.  However, note that edoc specs are just 
comments and are not really checked for consistency w.r.t. the code.

If you want to have specifications whose correspondence with the code is 
mechanically checked, then you should use -specs.

If you want both of the above, for the time being you should use both.
But the current plan is that -specs will eventually supersede @specs and 
Edoc will be adapted to generate documentation from them.  Most probably 
this will happen in R14 (March 2009 or about).


More information about the erlang-questions mailing list