[erlang-questions] Intel Quad CPUs
Tue Sep 4 19:08:21 CEST 2007
Kirill Zaborski wrote:
> On 9/4/07, *Kostis Sagonas* <kostis@REDACTED
> <mailto:kostis@REDACTED>> wrote:
> Currently, dialyzer does NOT use any edoc information for finding type
> In fact, it most probably never will since we are designing a new
> language for describing type information which will not appear just in
> And that language will be not compatible with edoc?
> Maybe its better to combine them (edoc and your language)?
Well, the two languages are of course closely related and could in
principle be combined, but currently there are some differences between
them. Edoc's language is just comments after all; the new one will have
to be accepted by the Erlang parser.
To give you an idea, in edoc you currently write something of the form:
%% @spec (integer(), float()) -> atom()
to describe the types of a function foo. In the new language you would
write (or preferably change the above edoc comment to be):
-spec(foo/2 :: ((integer(), float()) -> atom())).
> Or I will have to write 2 different lines of comments describing the
> same types?
The idea is that you would not have to write comments anymore. Doesn't
this sound wonderful? :-)
Humor aside, the point is: comments are dangerous because they suffer
from code rot; type information integrated in the language will most
probably not: its compatibility with the code will be checked.
More information about the erlang-questions