Enhanced type guard syntax]

Peter-Henry Mander erlang@REDACTED
Fri Sep 19 10:55:41 CEST 2003


Okay, how about going to extremes:

   f({{dictionary,store},X},{{dictionary,key},Y}) ->

Now you know they are related (-: and you can do a general case:

   f({{dictionary,_whatever},Thing}) ->

I would agree that my example is not practical, but it may seed another 
idea from someone?

Pete.

Thomas Arts wrote:
>>perhaps this:
>>
>>     f({list_of_integers,X}) ->
> 
> 
> this is inflexible for a type checker. The tuple notation is fine, but
> the verbose way of writing the atom hides the semantics.
> This is very clear in:
> 
> 
>>     f({dictionary_of_key_value_pairs,X},{key_for_dictionary,Y}) ->
> 
> 
> How do you know that there is a relation between the key in the first atom
> and the key in the second atom? They might refer to completely different
> things. That is where variables come in.
> 
> /Thomas
> 
> 
> 
> 





More information about the erlang-questions mailing list