[plt-scheme] efficient string operations yielding immutablestrings
Paul Schlie wrote:
> > In fact, wonder if even your intent may be better served by
> > being able to specify that a function is immutable, rather
> > than attempting to classify it's arguments as being so within
> > the body of the function?
This would be desirable from my perspective, and was alluded to multiple
times in the earlier discussion. However, it's very much outside of
anything Scheme currently provides. In particular, to do anything at all
with it statically, even approximately, would require significant changes
and additions to the R5RS model. It's much easier to imagine such a
property being added to R5RS with dynamic checking.
Static checking might fit more easily into PLT's module architecture, at
least from a design perspective. Its implementation likely wouldn't be
trivial.
> > (but realize that you're working with what you've got,
> > although it's not officially portable across arbitrary
> > conforming implementations).
Note that it is theoretically possible to write portable code that deals
with immutable strings, if the implementation supports immutable data at
all, since R5RS allows for the creation of immutable strings, either via
literal constants or as the result of the symbol->string operation.
Anton