Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!bloom-beacon.mit.edu!gatech!swrinde!pipex!uunet!sytex!smcl
From: smcl@sytex.com (Scott McLoughlin)
Subject: Re: why no substring sharing?
Message-ID: <FskFwc2w165w@sytex.com>
Sender: bbs@sytex.com
Organization: Sytex Access Ltd.
References: <bakulCzwEzw.Fp4@netcom.com>
Date: Sun, 27 Nov 1994 03:56:14 GMT
Lines: 30

bakul@netcom.com (Bakul Shah) writes:

> schwartz@galapagos.cse.psu.edu (Scott Schwartz) writes:
> 
> >Why does substring return a newly allocated string?
> 
> Because string-set! on the substring or the original string
> should not affect the other string.  May be strings and vectors
> should be implemented using the copy-on-write technique....

Howdy,
        Surprised no one has mentioned CL which defines many
of its STRING and SEQUENCE operators to take :START and :END
keyword arguments to avoid substring/subseq consing.
        In other words, the cat has been skinned in another
Lisp, although displaced strings weren't the selected 
mechanism. Of course, Common Lisp has displaced strings as
well.
        As far as I know, Scheme was designed to be a small
simple language with a small simple "standard library". Given
that is _is_ possible to define SUBSTRING in a subset of 
Scheme without SUBSTRING, I'm sort of bummed that SUBSTRING
is in the langauge at all. I'd prefer Scheme to evolve 
toward a language with _fewer_ standard functions/runtime
features. 

=============================================
Scott McLoughlin
Conscious Computing
=============================================
