Mark H Weaver writes: > Okay, good point. Indeed, the expansion time of our 'and' and 'or' > macros is quadratic in the number of operands. They are implemented in > boot-9.scm as follows: > > (define-syntax and > (syntax-rules () > ((_) #t) > ((_ x) x) > ((_ x y ...) (if x (and y ...) #f)))) > > (define-syntax or > (syntax-rules () > ((_) #f) > ((_ x) x) > ((_ x y ...) (let ((t x)) (if t t (or y ...)))))) > > The problem is that the "y ..." pattern has to iterate down the entire > list to verify that it's a proper list, and this is done for each > operand. Why would it have to do that? It cannot be anything valid else if it is a pair. Note that the compiler does not bother to do this for other cases: if I write