[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
DOTIMES or REPEAT, and old-style DO flushable?
- To: BUG-LISP at MIT-MC, BUG-LISPM at MIT-MC
- Subject: DOTIMES or REPEAT, and old-style DO flushable?
- From: "Guy L. Steele, Jr." <GLS at MIT-MC>
- Date: Tue ,15 Apr 80 00:57:00 EDT
cc: EJS at MIT-MC, JONL at MIT-MC, H at MIT-MC, KMP at MIT-MC,
HENRY at MIT-MC
From: Eric J. Swenson <EJS at MIT-MC>
I've long thought that the time had come to flush the old-style DO. I
don't think it presents a substantial saving of coding space, and being as
un-general as it it, is not worth keeping.
From: Alan Bawden <ALAN at MIT-MC>
There is a saying about such ideas: "you're in charge!".
I observe that the lexical distance between an old- and new-style
DO is precisely six characters: "(())()":
(DO x y z w . body) ==> (DO ((x y z)) (w) . body)
But much as I would also like to flush it, I must agree with ALAN.
Bletcherous idea: let (DO (NAME) ...) be the way to name a DO?
By the way, guys, I want to push again for the additional interpretation
(DO (((var11 init11 step11) (var12 init12 step12) ...)
((var21 init21 step21) ...)
((varn1 ...) ...))
(test ... retval)
where variables within each group are processed in parallel, but the groups
are processed serially. Moreover, in the first group omitting a stepper
means don't step (as now), but in other groups means the stepper form
is the same as the init form. This allows one to do, for example:
(DO (((X L (CDR X)))
((Y (CAR X)) (Z (CAAR X) (CDAR X))))
((OR (NULL X) (EQ Z 'LOSE)) (BARF))
I.e. Y is always the CAR of X, and Z is a function of X also.
This is not the same as a LET in the body, as these computations
get done before the endtest is evaluated each time.