Strings started out being just lists of characters. However, this caused problems with string literals. Since a string literal was a list it would be evaluated as a list. It was thought that implicitly quoting a string literal would fix this. But then there were problems because a string literal as entered was not the same as a string literal as printed. In one case the double quotes meant implicit quote. In the second they meant simply that something which appeared to be a string had been found. In addition there were nagging issues of what it meant when one found a non-character entity in a string. Or if the tail was a character rather than a string.
A new type which is identical to a list in its function behavior but is evaluated as a normal function rather than a list was introduced. This requires the addition of a new string-cons
function. However, car
, cdr
and all other list functions work on both strings and lists.
jwalker@cs.oberlin.edu |