[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: rfi: immutable strings
From: |
Andy Wingo |
Subject: |
Re: rfi: immutable strings |
Date: |
Thu, 27 Jan 2011 17:31:53 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
On Fri 07 Jan 2011 19:52, Mike Gran <address@hidden> writes:
>> Guile needs immutable strings.
>
> How is this different from read-only strings?
Seems to be the same. We should have read-only string API though;
currently there is only substring API. One should be able to allocate a
read-only string directly, like via
scm_from_static_latin1_{stringn,symboln}. Also, strings loaded from
objcode should be read-only, and share storage with the objcode itself;
perhaps?
>> Also, the result of (symbol->string 'foo) should be immutable;
>> currently symbol->string conses up a new shared substring every time.
Though the result is immutable, it does cons up a shared substring,
which involves all kinds of mutex and allocation shenanigans.
Andy
--
http://wingolog.org/