[hunchentoot-devel] Hunchentoot with ECL

Marc Battyani marc.battyani at fractalconcept.com
Wed Mar 26 08:52:37 UTC 2008


Edi Weitz wrote:
> On Wed, 26 Mar 2008 02:23:04 +0100, css <css at swissjabber.ch> wrote:
>   
>> I had to replace the form
>>
>> (loop for key = (read-line *hunchentoot-stream* nil nil)
>>                              while (and key (string-not-equal key "end"))
>>                              for value = (read-line *hunchentoot-stream* t)
>>                              collect (cons (make-keyword key) value)
>>                              do (maybe-write-to-header-stream key value)))
>>
>> by some tagbody-go-form, because ECL doesnt support it.
>>     
> ECL doesn't support LOOP?!?
>   
Unfortunately though handy, LOOP has a lot of quirks as well as under 
specified areas.
So here your usage of loop is not fully compliant because you use a FOR 
clause after a WHILE clause:

 From CLHS 6.1.2.1 Iteration Control:

The iteration control clauses for, as, and repeat must precede any other 
loop clauses, except initially, with, and named, since they establish 
variable bindings. When iteration control clauses are used in a loop, 
the corresponding termination tests in the loop body are evaluated 
before any other loop body code is executed.

This is why I switched to ITERATE in cl-pdf/cl-typesetting for complex 
loops. I still use LOOP a lot for all the simple loops though.

Marc





More information about the Tbnl-devel mailing list