[erlang-questions] Intel Quad CPUs

Erik Stenman erik.stenman@REDACTED
Thu Sep 6 23:15:41 CEST 2007


On 6 sep 2007, at 22.14, Damien Morton wrote:

> +1 on less syntactic clutter.
>
> The /2-ness of foo is clear from the remainder of the type  
> specification
>
> There are redundant parentheses too - are they neeed?
>
> -spec(foo :: (integer, float) -> atom)
>
>  just reads better to me

The parentheses are needed to distinguish between a literal and a type.
   integer() means any integer.
   integer means the atom 'integer'

/Erik

>> On Tue, 4 Sep 2007, Kostis Sagonas wrote:
>>
>>> In the new language you would write (or preferably change the  
>>> above edoc
>>> comment to be):
>>>
>>> -spec(foo/2 :: ((integer(), float()) -> atom())).
>>>
>>
>> What is the reason for the trailing ()s? It would be nice if the  
>> syntax
>> had less redundant visual noise.
>>
>> Tony.
>>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>




More information about the erlang-questions mailing list