[erlang-questions] Strings and Text Processing

Thomas Lindgren <>
Sat Dec 29 17:15:28 CET 2012


>________________________________
> From: Steve Davis <>
...
>Finally, here's my two questions:
>1) Is there any benefit at all to the "list representation" of strings above binary text?
>2) If not, I wonder if there's any way to change our minds about "strings" as we enter 2013?


1) Don't forget the good old I/O-list, which some might consider the "real" string representation.

2) The groundswell seems to be to use binaries instead of lists, even if the syntax is a bit of a pain. So keep building and backporting support for that, IMO. 


Alternatively, it might be worth considering a higher-level datastructure that takes encoding and such into account too. Common Lisp took the route of making characters a separate, opaque datatype if memory serves. Strings as builtin CL-style "compact arrays of characters" (suitably updated to handle unicode!) could perhaps replace the use of binaries.
 

Best,

Thomas



More information about the erlang-questions mailing list