[erlang-questions] Extensions to comprehensions eeps

Anthony Shipman als@REDACTED
Wed Jul 30 11:13:09 CEST 2008


A recent eep says

    Currently, Erlang has

        Pattern <- Expr

    to enumerate over the elements of a single list and

        Pattern <= Expr

    to enumerate over a binary.  EEP 12 [1] adds

        Pattern [<-] List
        Pattern {<-} Tuple
        Pattern <<<->> Binary

Why the plethora of obscure arrow symbols? We should only need the one arrow. 
Since it is a dynamic language the system should know what type of collection 
is supplied and iterate appropriately.

With the above symbols if I change a string from a list to a binary I've got 
to go and change all of the comprehensions.

The funny symbols are a kind of type annotation by stealth that is quite 
irregular in the language.

-- 
Anthony Shipman                    Mamas don't let your babies 
als@REDACTED                   grow up to be outsourced.



More information about the erlang-questions mailing list