Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!news.alpha.net!uwm.edu!spool.mu.edu!news.cs.indiana.edu!johnl@cs.indiana.edu
From: "John Lacey" <johnl@cs.indiana.edu>
Subject: Re: Arrays are just Vectors.
Message-ID: <1994Nov5.222226.21086@news.cs.indiana.edu>
Organization: Computer Science, Indiana University
References: <1994Oct30.192000.19926@news.cs.indiana.edu> <5Nov1994.002912.Alan@LCS.MIT.EDU>
Date: Sat, 5 Nov 1994 22:22:20 -0500
Lines: 60

Alan@lcs.mit.EDU (Alan Bawden) writes:

>   From: John Lacey <johnl@cs.indiana.edu>

>   I have seen implementations (nay, even written them) which
>   represent vectors as balanced trees.

>Oh get real.  It is perfectly clear what the authors of R4RS were trying to
>say in that paragraph.  You may be able to weasel out of it today because
>in R4RS they didn't express themselves clearly, but now that you've brought
>it to their attention, I expect they'll fix it in R5RS.

I certainly hope they won't. They were clearly leaving the door
open for implementations such as the ones I mentioned. This
language was introduced in R4RS (it isn't in R3), apparently at
the suggestion of Pitman. The door for implementing vectors as
lists was discussed along with the disjointness of types.

I would be happy for them to say that access is typically
constant-time. I would be aggrieved if they were to require
constant-time access. That seems like a quality of implementation
issue to me.

>I am not aware of any serious Scheme implementation that plays the language
>lawyer weasel cop-out you are suggesting here.

I would call the implementations I have seen use it serious.
Where you were intending to draw that line isn't clear, but I
would consider funded research serious. I don't consider it a
cop-out, particularly when the language was clearly carefully
chosen to allow for just such a case.

>   I would point out, as Don Hosek recently did for typefaces,
>   that no programming language is useful in all cases. General-
>   purpose is a misnomer when applied to programming languages.

>And this final remark seems like a total non sequitur.  I can't even
>recall anybody using the phrase "general purpose" anywhere in the current
>discussion.

I wasn't aware that introducing new phrases was against the rules
of the discussion. My point was that this discussion of emulating
constructs from other languages in Scheme in only of minor
interest. In this case, a good emulation of multi-dimensional
arrays is pretty easy. In the general case, however, Scheme would
be damaged, and not improved, by adding features present in other
languages, or even elegantly generalizing existing features to
match or better those found in other languages. Not all languages
have the same purpose. Scheme's purpose as a research language is
an important one (a serious one, if I'm not allowed to introduce
the word "important" into the discussion).

This harks back to my comments on vectors. Allowing an
implementation the freedom to implement vectors as lists is an
important one. Requiring constant-time access is not a semantic
issue, and the extra baggage can be harmful in research work (for
example, reference counting memory or reflection, to name two
such projects).

John L
