Subject: Re: String Representation

From: "Richard A. O'Keefe" <[email-masked]>
Date: Tue, 16 May 2000 11:02:02 +1200 (NZST)

I suppose enumerating the atom table occurs infrequently enough not to be 
	an issue.  What are the overheads associated with storing lists of 
	characters or lists of single character atoms?

I note that NU Prolog had a special representation for lists of
small integers, so that "abc" was indeed rather more compact than
[a,b,c].  The person who implemented that feature told me that in
his judgement, based on measurements afterwards, it was a waste of
time.

Note that Java/Javascript use 16-bit characters, and that strictly
speaking they _should_ use 31-bit characters.  In QP, lists of integers
took 2 cells (8 bytes) per character, and lists of atoms took the same.

Using a *single* atom to hold a string has the advantage that if there
are several occurrences of exactly the same string, they will share the
representation, so you can get less than 1 byte per character.