[erlang-questions] Accessing function specifications

Kostis Sagonas <>
Wed Sep 1 20:09:36 CEST 2010


Svatopluk Šperka wrote:
>  Hi,
> 
> would anybody know if it is possible to access type specification of a 
> function in the same module at runtime ?

Yes, it is possible. (*)

> And secondly is it possible to 
> declare different specification for each function clause (yeah, pretty 
> dirty but the end justifies the means ;) ?

Yes, this is also possible ;-)  (**)

Cheers,
Kostis

  (*) Though the only tool I know of is not released, so effectively the 
answer to your question is: "You have to do it yourself somehow".

(**) Look for overloaded specs here: 
http://www.erlang.org/doc/reference_manual/typespec.html#id2272692


More information about the erlang-questions mailing list