Olin Shivers (email@example.com) wrote:
|| > If one had to choose a single type for everything, a string is a
|| > pretty good choice. Why not a number? How would you represent a
|| > string with a number?
|| Perlis, as usual, summed it up well in one of his aphorisms:
|| The string is a stark data structure, and everywhere it
|| occurs there is much hiding of information.
|| This is what is wrong with both Unix and tcl. Their power is also a great
|| weakness: they are designed around a "least common denominator"
|| representation, strings. What it buys you is that everything interoperates.
|| The above aphorism explains what it costs you.
Notice this is why I said "if one HAD to" choose a single data type,
a string would probably be it. I didn't argue that it was a good idea.
In other words, given that you had to choose one type that a language
had to be in, what would you choose? The problem with lists is that
a list is really a compound data structure. For example, in a Lisp
list (a (b c)), what is "a", "b", and "c"? Lists are built from
basic elements. Yes, yes, you can build up some sort of counting by
using the empty list and list of empty lists, and so on, but again,
ease of programming counts.
My preference is to have multiple types.