Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!gatech!udel!princeton!news.princeton.edu!blume
From: blume@dynamic.cs.princeton.edu (Matthias Blume)
Subject: Re: why no substring sharing?
In-Reply-To: snark@bark.COM's message of 26 Nov 1994 17:27:13 -0500
Message-ID: <BLUME.94Nov26204027@dynamic.cs.princeton.edu>
Originator: news@hedgehog.Princeton.EDU
Sender: news@Princeton.EDU (USENET News System)
Nntp-Posting-Host: dynamic.cs.princeton.edu
Organization: Princeton University
References: snark@bark.COM (Impatient Observer) <9411262226.AA13273@bitsy.MIT.EDU>
Date: Sun, 27 Nov 1994 01:40:27 GMT
Lines: 37


In article <9411262226.AA13273@bitsy.MIT.EDU> snark@bark.COM (Impatient Observer) writes:

   --text follows this line--
   > schwartz@galapagos.cse.psu.edu (Scott Schwartz) writes:
   > Organization: Penn State Comp Sci & Eng
   >
   > Why does substring return a newly allocated string?

   Because strings in Scheme, like vectors, have an object header which
   contains their type code and length.

This is not true.  Such implementation details are not part of the
definition of Scheme.  And it is not even necessarily true that
SUBSTRING returns a newly allocated string.  It only needs to *behave*
like a newly allocated string.  Somebody else already explained this
in this forum: STRING-SET! on the result of SUBSTRING must not
(observably) modify the original argument to SUBSTRING.

      most
      scheme implementations are slow, nonoptimizing interpreters, ...

   ``Most''? Please enumerate all implementations you are aware of, annotating
   each one which is a ``non-optimizing interpreter''. I bet you would
   severely embarrass yourself while offending most living implementors.

I think that the most widely used Scheme implementation falls into the
category of fast non-optimizing Scheme interpreters -- which is
somewhere in the middle.  If you count every implementation of Scheme
as one unit, then Scott's assertion is true, because almost everybody
(:-) wrote a little metacircular interpreter for Scheme at some point
in his or her life.  However, if we weight each implementation
according to the number of its users, then the Impatient Observer is
right.

--
-Matthias
