[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

DRAFT of the Revised Revised Report




0)	I agree that car, cdr, etc, are poor names, yet I have not
seen good alternatives to them except first and rest, which don't nest
(a la c....r) too well.  I think that their use is so entrenched that
it would be hard to get used to other things.

	Random related comment: A possibility we have not considered
is general-car-cdr:

(general-car-cdr #b1    l) = l
(general-car-cdr #b10   l) = (car l)
(general-car-cdr #b11   l) = (cdr l)
(general-car-cdr #b101  l) = (cadr l)
(general-car-cdr #b110  l) = (cdar l)
etc.

Thus c....r = (lambda (l) (general-car-cdr n l))

Where n = #b1**** with the mapping a->0 b->1

	C...r (except car and cdr) are defined like that in MIT
Scheme.  Note that general-car-cdr is not limited to a length of 4 for
the chain of car-cdrs, and is trivial to implement.

2 & 5)	The reason for not having a different name for the one-armed
IF is that we tried very hard to keep the number of special forms to a
minimum.  Since they are easily distinguished by the number of
subforms, there is no need to add another.  Note that the same
philosophy leads MIT to have named LET, which is exactly (except for
the name) what ITERATE used to be.

3)	I don't think that the syntax (named-lambda name expr) is a
good idea as a substitute for rec.  An extension of rec would allow
something like (rec a-circular-list (cons 'a a-circular-list)) where
there are no lambdas, so named-lambda is inappropriate.

	Note that both rec and named-lambda are optional, so there is
no need to drop any.  Different dialects have preferences for one
over the other, so an arbitrary decision would probably not sit well.

	Note also that MIT Scheme allows also the syntax
(named-lambda ((foo . args1) . args2) . body) =
	(named-lambda (foo . args1) (lambda args2 . body))
	which is not on the report.

9)	I don't think that the list? you propose is missing.  I think
list? should be defined as

(define (list? l)
  (or (null? l) (and (pair? l) (list? (cdr l)))))

, in other words, proper-list?.

	What you define as list? is what we (MIT-Scheme) call
weak-list? which we have never found a real use for.

	I would like to eliminate the confusion about lists.  I
propose that list refer to proper lists, and anything else built out
of pairs be called a pair-graph.  Thus lists are pair-graphs but not
viceversa.  The procedure LIST produces a list, and the procedure
LIST? tests whether an object is one.