In general we can say we use tuples where we would use "records" or "structs" in other languages and we use lists when we want to represent things which have varying sizes, (i.e. where we would use linked lists in other languages).
Erlang does not have a string date type, instead strings can be represented by lists of ASCII characters. So the list[97,98,99] is equivalent to "abc". The Erlang shell is "clever" and guesses the what sort of list we mean and outputs it in what it thinks
is the most appropriate form, for example:
30> [97,98,99].
"abc"
Only a few built in functions can be used in guards, and you cannot use functions you have defined yourself in guards. (Aside for advanced readers: This is to ensure that guards don't have side effects).
~p Writes the data with standard syntax in the same way as ~w, but breaks terms whose printed representation is longer than one line into many lines and indents each line
sensibly. It also tries to detect lists of printable characters and to output these as strings.(求翻译)