[plt-scheme] immutable strings

From: Rohan NIcholls (rohan.nicholls at pareto.nl)
Date: Thu Sep 30 08:03:40 EDT 2004

I am sure that this has been hashed out, but as a quick search reveals
nothing, can someone please explain why so often I end up with
immutable strings.

In the standard it claims only literal constants and the return from
symbol->string are immutable, which makes sense.

In the plt language manual it says that anything generated by read.
Is this for efficiency reasons?  I can't think of any other reason,
but then I am still only a beginner in the plt world.

Does that mean that the regexp functions use a string port, so their
return value will be immutable?  If there is another reason please let
me know, as these immutable strings seem to be the bane of my



P.S. This came up yet again, as I did an unofficial experiment to help
generate code in php to make my life faster and easier.  At first I
did the script in php, and thought I wonder how long it will take in
scheme, which I have not had time to use in a while, and with all the
searching in the help-desk (lots and lots of this went on) included,
it took about one half the time, and (which I think is more
significant for larger projects) one half the code.
Just thought I would let you know....:-)

Posted on the users mailing list.