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

COND/DO consistency



   Date: Tue, 7 Nov 89 15:07:18 EST
   From: "Michael R. Blair" <ziggy@hx.lcs.mit.edu>

   | (DO ((<variable> <init> <step>)
   |      ...)
   |     (<test> <expression>...)
   |   <command>...)
   |
   | If the <test> evaluates to a true value, then the value of the last
   | <expression> is returned as the result of the DO. If no <expression>s
   | are present, then the value of the DO expression is unspecified.

   I propose that this last line read "then the value of the <test> is
   returned as the value of the DO expression." for consistency with the
   way test clauses are handled in COND.

To really increase the regularity of DO and COND, DO would have to take a
series of test/expression sets.  The syntax would then be

 (DO ((<variable_1> <init_1> <step_1>)
      ...)
     ((<test1> <expression>...)
      (<test2> <expression>...)
      ...
     )
   <command_1>...)
 
In this case I would be in strong support of regularizing the handling of the
test expression.  

Unfortunately, such an incompatible change is not likely to gain much support
given that the old syntax is already firmly established in many peoples
programs.  
-------------------------------------------------------------------------------
Morry Katz
katz@cs.stanford.edu
-------------------------------------------------------------------------------