edoc question

Richard Carlsson <>
Fri Oct 21 11:47:57 CEST 2005


Martin Bjorklund wrote:
> How do I specify that a parameter to a function should be a certain
> record?
> 
> I'd like to write
>   
>   %% @type Foo = #foo{}
> 
> but that doesn't work.

Right now there is no support for the #foo{} syntax in edoc,
...
But! - I've recently added it, and it will be in R10-8!
(Quite possibly without any documentation, but you should
be able to use it, as in your example above.)

Note that I recommend using names like foo() for datatypes
in Erlang, rather than variable names such as Foo, which are
more typically used as type variables (i.e., that are bound
to some data type).

> I tried another variant, to use edoc comments like this:
> 
>   % % @type Foo = #foo{}
> 
> but it seems as edoc parses the expression even if it's commented out?

Hm. It shouldn't. Can you produce a test case?

	/Richard

----
 "Having users is like optimization: the wise course is to delay it."
   -- Paul Graham



More information about the erlang-questions mailing list