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

somewhat obscure DO feature



    Date: 3 April 1981 00:37-EST
    From: Steven T. Kirsch <SK at MIT-MC>

    Doing (DO ((A 1 2)) () (PRINC "LOOP")) will complain about ((A 1 2))
    being improper ("extraneous stepper") rather than the exit condition
    being improper.

Unfortunately the error message is correct.  The "2" really is an
extraneous stepper.  This is because there is an obscure feature in DO
where an exit clause of just NIL, means to execute the body of the DO
EXACTLY once.  It is a way of writing a PROG with some initial values.
It is also one of the least well known features of the language.