[erlang-questions] What's the difference between tuple and list ?

Bengt Kleberg bengt.kleberg@REDACTED
Tue Sep 25 13:14:00 CEST 2007


it is as simple as it says. if you have a variable amount of things you 
store them in a list (ex: the number of people inside a room). if you 
have a fixed number of items you store them in a tuple. (ex: descriptive 
data about a person, like age and name).

Those were the days...
    EPO guidelines 1978: "If the contribution to the known art resides
    solely in a computer program then the subject matter is not
    patentable in whatever manner it may be presented in the claims."

On 2007-09-25 12:53, raocheng wrote:
> The Pragmatic Programming Erlang says:
> 1) Suppose you want to group a fixed number of items into a single 
> entity.For this you'd use a tuple.
> 2) We use lists to store variable numbers of things.
> However, we know that variables in Erlang are in essence invariable. So 
> what is the difference between tuple and list ?
> Thanks in advance.
> ------------------------------------------------------------------------
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions

More information about the erlang-questions mailing list