This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: gh_symbol2scm
- To: guile at sourceware dot cygnus dot com
- Subject: Re: gh_symbol2scm
- From: Lynn Winebarger <owinebar at free-expression dot org>
- Date: Tue, 26 Oct 1999 14:28:54 -0500 (EST)
On 26 Oct 1999, Mark Galassi wrote:
> Lynn> Q: Is there any reason that gh_symbol2scm(char *) isn't
> Lynn> gh_symbol2scm(const char *)?
>
> Not that I can think of. I guess I'm old school, from before there
> were "const char *" declarations, so I never think of doing that.
>
> Can the compiler optimize better it you tell it that the string will
> not be mutated?
>
It should be able to at least reduce space. I'm using a lot of
constant strings to create tagged lists, so I get a lot of warnings about
losing constness of the strings. I would guess this prevents it from
collecting occurences of the same constant string and sticking it in a
code section of the object file.
FWIW, I never think of doing it either, until I get compiler warnings.
Lynn