unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Mike Gran <spk121@yahoo.com>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: rfi: immutable strings
Date: Thu, 27 Jan 2011 17:31:53 +0100	[thread overview]
Message-ID: <m3aaimgveu.fsf@unquote.localdomain> (raw)
In-Reply-To: <245692.94996.qm@web37905.mail.mud.yahoo.com> (Mike Gran's message of "Fri, 7 Jan 2011 10:52:35 -0800 (PST)")

On Fri 07 Jan 2011 19:52, Mike Gran <spk121@yahoo.com> 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/



  parent reply	other threads:[~2011-01-27 16:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-07 18:52 rfi: immutable strings Mike Gran
2011-01-08 21:57 ` Ludovic Courtès
2011-01-27 16:31 ` Andy Wingo [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-01-07 16:57 Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3aaimgveu.fsf@unquote.localdomain \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=spk121@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).