[erlang-questions] Documenting records and .hrls with edoc

Richard Carlsson <>
Wed Nov 8 14:14:57 CET 2006


Samuel Rivas wrote:
> I see.  Until improved type definitions are available, would it be worth
> checking that the field names in the documentation are in the record 
> definition? 

Yes, that's a good idea. Edoc is not doing much right now (in general) 
to check that declarations actually match the code; it tends to just 
trust what you write. This could be improved.

> For example, edoc already checks other things like function arity:
> 
> %% @spec foo(bar, baz) -> []
> foo(_) ->
>   [].
> 
> Edoc will complain about bad arity in the specification.  I do not know
> whether it is to expensive to do the same thing for records, knowing that
> they may change in a future.

It's not expensive, just a matter of programming. And I've had way too 
little spare time lately, alas. Patches are happily accepted.

     /Richard




More information about the erlang-questions mailing list