[erlang-questions] Accessing function specifications

Svatopluk Šperka sperka@REDACTED
Thu Sep 2 10:45:19 CEST 2010


  Thanks for the reply.

I believe dialyzer could serve as inspiration for how to extract specs. 
Anyways I've figured other, more 'manual' way of how to do what I need.

On 9/1/10 20:09 , Kostis Sagonas wrote:
> 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