[erlang-questions] Noddy question on hashing
Siraaj Khandkar
siraaj@REDACTED
Fri Jul 26 02:33:36 CEST 2013
On 07/25/2013 04:06 PM, Motiejus Jakštys wrote:
> On Thu, Jul 25, 2013 at 7:38 PM, Siraaj Khandkar <siraaj@REDACTED> wrote:
>> On 07/25/2013 05:52 AM, Rick Payne wrote:> Hi,
>>
>> If you're interested in correctness and want those attributes to be
>> enums - you could use atoms as values and tell Dialyzer what each is
>> expected to be, like so:
>>
>> -type attribute_a() :: a
>> | b
>> | c
>> .
>>
>> -type attribute_b() :: d
>> | e
>> | f
>> .
>>
>> -record(object,
>> { a :: attribute_a()
>> , b :: attribute_b()
>> })
>>
>> -type object() :: #object{}.
>>
>
> Note that once you have 13 or 14 of them they will just be reduced to 'atom()':
> http://erlang.org/pipermail/erlang-questions/2012-August/068851.html
>
I did not know about this limit. Very, very important to know. Thank you
for bringing it up!
More information about the erlang-questions
mailing list