Am Mi., 29. Apr. 2020 um 01:46 Uhr schrieb John Cowan <co...@ccil.org
> A counterexample is seek(), a Unix system call that could offset the file pointer by up to 2^15 bytes in either direction and returned the new file pointer as a signed int. When it became clear that both disks and files would be much larger in the future, then rather than breaking backward compatibility, a similar system call lseek() for "long seek" was added. Seek() is long since forgotten, but the new name served its purpose at the time and the extra letter is now of no consequence to anyone.
And now we also have llseek(). This doesn't make a language more
beautiful or easier to use.
I understand that there weren't many options for the C programming
language as maintaining backward compatibility is very important there
(as it is for the TeX engine, say). But Lisp and Scheme are neither C
nor TeX. One shouldn't easily break backward compatibility but not
allowing it altogether would be detrimental to Scheme as a programming
language of elegance and that, at least in the past, had set out to
>> This is the least convincing point for me. If R7RS stuck to the R6RS
>> condition system (maybe too large for the small language), more and
>> more implementations would have gradually adopted it
> Or, as my father (a lawyer) used to say whenever I said anything dogmatically, perhaps they would not. WG1 really did work very hard to minimize the cost of conversion.
This couldn't have been the only goal. :) Otherwise, you have come up
with R5RS. ;)
>> In retrospective (I know that it is unfair), I have doubts.
> Well, let me urge you to look at <https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/SixRejection.md
>, which is a precis of the comments, mostly objections, given by the R6RS voters. (There is a link to the originals.) At that time, negative votes were required to have comments; affirmative votes were not. There is also information on how R7RS-small responded to the objections and how R7RS-large might do so. (Note that this is a 2017 document and some of my opinions have changed.)
I do not subscribe to everything the negative votes to R6RS complained
about. (Nor do I agree with R6RS in every aspect.) Many objections
have their roots in the size of the R6RS standard (a fair point!), but
to account for these, one could have simply made some libraries (e.g.
syntax-case or eval or the reader or writer optional).
I agree with the change from LIBRARY to DEFINE-LIBRARY for the reasons
given, especially because it is easy for a system to support both
conventions. Packaging the predefined identifiers differently in the
standard libraries is also fine as is providing the same functionality
under different names (cf. the division operators).
Identifier syntax is not too important for a system supporting only
SYNTAX-RULES. In conjunction with a more powerful system, they have
too many sensible uses that one shouldn't leave them out (the point
that this would make macros weaker is not convincing to me; with the
same reasoning, a standard should only support one thread...).
There is one thing, however, where R7RS definitely did it wrong and
also broke compatibility with R6RS needlessly, namely that local
syntax definitions shouldn't affect earlier expressions in the same
local group. I know your rationale for this, but it just makes one
blind because it sounds so convincing. (And even with the R6RS
semantics, no one forces you to write a program that does not
introduce the syntax first.)
Here are four reasons why the R6RS semantics are the "right" and why
the intended R7RS semantics are fundamentally flawed:
(1) Will Clinger's idea that R7RS is a superset of R6RS (without the
mustard) would be flawed. Schemes supporting both R6RS and R7RS will
most likely implement only one of the two semantics. Larceny uses the
R6RS semantics, for example. Sagittarius as well, I think.
(2) Writing an expander that adheres to the R7RS semantics is more
complicated than to write an expander for the R6RS semantics, showing
that the R7RS model is actually logically more complicated.
(3) Some kind of referential transparency is lost: Consider the following macro:
((_ even? odd?)
(define (even? x) (or (zero? x) (odd? (- x 1))))
(define (odd? x) (and (not (zero? x)) (even? (- x 1))))))))
It is supposed to be used in a definition context as in the following code:
(define-even-odd even? odd?)
Will it work? Well, it depends on the lexical context with the R7RS
model: If `odd?' is defined as a macro outside the lambda, the code
(4) In any sensible use of Identifier macros the defined syntax should
behave as a variable (reference). It cannot, however, when R7RS makes
the superficial distinction between one type of syntax, namely
variable reference, and all other types of syntax.
For example, a common idiom (when you have identifier macros) to
support not-so-much-optimizing compilers is:
(define-syntax pi (identifier-syntax 3.14159))
This should, in all aspects, behave as the definition of an immutable
variable. It doesn't though in the presence of the R7RS semantics. The
following code in the same module would break:
(define (qoppa x) (or (zero? x) (pi (- x 1))))
(define (pi x) (and (not (zero? x)) (qoppa (- x 1))))
Therefore, I advise everyone to read the R7RS in a way that leads to
the R6RS semantics. :) Moreover, I would suggest that R7RS-large
corrects the mistake. I believe that no existing program would break.
> Indeed it can, and at this point I consider the libraries of R7RS-small frozen, with the possible exception of (scheme base), which is a special case due to the fact that REPLs must provide it at least. I hope though that it can be kept intact, and everything new put in a library somewhere. This makes for arbitrary-looking separations between procedures in an older library from their close relatives in a newer one, but we can't have everything.
Are you speaking about R7RS-large here or over some imagined future R8RS?
> I hope that Arew ("R7RS over Chez") will progress further to become possibly the fastest available R7RS Scheme, and indeed I hope that Loko will become R7RS-capable as well, in the style of Larceny or Sagittarius.
Two more reasons to revert to the R6RS semantics when it comes to
deferring the expansion of the right hand sides.