[iterate-devel] *list-end-test*

Hoehle, Joerg-Cyril Joerg-Cyril.Hoehle at t-systems.com
Mon Apr 23 16:01:13 UTC 2007


Hi,

I've had time to think about the issue some more (and to read the CLHS on loop yet again).

>Actually, there could be somewhat distinct votes
>1. Eliminate or not
>2. FOR IN dotted list: error out (like LOOP) or not 
>(compatible, someone's code may depend on this) -- apparently, 
>that's the issue where opinions diverge.

Here's what I'm going to do when I'll have time:
+ Eliminate *list-end-test*
+ FOR IN uses ENDP (like Attila favours), like LOOP 6.1.2.1.2
+ FOR ON uses ATOM, like LOOP 6.1.2.1.3
+ add test cases
+ document change in behaviour.

So FOR IN will error out on dotted lists (if iteration reaches the end).

If your software depends on the old behaviour, write your own driver, or use the completely trivial transformation:
old FOR var-spec IN on dotted lists == FOR (var-spec) ON dotted-list

The elimination of a global variable which affects the behaviour is TRT.
I bet no library writer whose library depends on a particular setting of that variable for his/her code to work has ever written:
(defmacro my-iter (&body body)
  ;; I depend on this setting or I'll crash or worse, misfunction!
  (let ((iter::*end-test-list* 'cl:endp))
    (macroexpand (cons 'iter:iter body))))

(setq iter::*end-test-list* #) is the wrong thing to do in any library that itself uses Iterate.  It's clear why, isn't it?

Regards,
	Jörg Höhle



More information about the iterate-devel mailing list