This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RO-strings in Guile


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