[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] fresh empty strings
-----BEGIN PGP SIGNED MESSAGE-----
On 01/23/2012 12:41 PM, John Cowan wrote:
>> Although an empty string denotes no locations, the string object still
>> must have a location in the store, at least in a semantic sense. If it
>> didn't, it would not be possible to refer to it.
> Bignums occupy space in the store, but they are not *locations* in the
> technical sense of the report.
Indeed. As a practical example, an implementation might well have a
special immediate single-word value for the empty string (like many of
them do for #t, #f, and other specials like '() and the eof object), and
all the string operations special-cased to treat it as a zero-length string.
A very sophisticated (or over-engineered) implementation might well have
different string implementations for zero-length, up to 32 byte, up to
64KiB, and larger strings, each agressively tuned for the expected usage
profiles of strings of those lengths... Short strings might be
represented in a single SSE2 vector register or something, while huge
ones implemented as a tree of pages!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
Scheme-reports mailing list