Re: RO-strings in Guile

Tom Tromey (tromey@cygnus.com)
19 Oct 1997 12:12:25 -0600

Jim> The SUBSTRING primitive should work by sharing space with its
Jim> source string, but both should be marked as shared, so that if
Jim> either is side-effected, Guile will actually copy the string
Jim> first.

Suppose you have a very large string, and a small substring. Won't
modifying the large string cause it to be copied? Ideally you'd like
the substring to be copied instead.

Jim> If we have the above, then we can implement symbol->string using
Jim> sharing, making it efficient enough that separate primitives
Jim> which accept symbols as strings (like const-string-append) will
Jim> be unnecessary.

I like this.

Tom

-- 
tromey@cygnus.com                 Member, League for Programming Freedom