[erlang-questions] Question on pattern matching from Joe's book

Matthew Dempsky <>
Fri Jul 27 22:49:33 CEST 2007


On 7/27/07, Prakash Swaminathan <> wrote:
> Why is the value assigned to T-> "at" and not "97116"?

"cat" is short-hand notation for the list [99, 97, 116].  The
statement [H|T] = "cat" is equivalent to [H|T] = [99, 97, 116], which
binds H to 99 and T to [97, 116] or "at".



More information about the erlang-questions mailing list