[erlang-questions] Intel Quad CPUs

Kostis Sagonas kostis@REDACTED
Thu Sep 6 11:27:36 CEST 2007


Serge Aleynikov wrote:
> Kostis Sagonas wrote:
>> 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())).
>>
> 
> Would there be a way to specify concrete values (such as atoms 'ok' and 
> 'error' shown below) rather than types, similar to edoc style?
> 
> @spec () -> {ok, integer()} | {error, string()}

Yes.  This exists already.

Kostis



More information about the erlang-questions mailing list