[iterate-devel] thereis and always/never conflict revisited

Hoehle, Joerg-Cyril Joerg-Cyril.Hoehle at t-systems.com
Mon Feb 7 16:53:10 UTC 2005


Hi,

I've been thinking about this way of removing the ambiguity of contradicting defaults for always/never and thereis.

CLtL2's loop thereis does not mention a default. ANSI-CL does.
My reading of CLtL2 is compatible with an implementation of thereis as
`when expr return it' -- no default value is supplied.
Maybe CLtL2 didn't mention it because the default return of loop is NIL anyway, but who knows?

Now, I propose to implement thereis in Iterate exactly like this.

Benefit:
o Some meaning associated to a form previously rejected as ambiguous (always/never with thereis).
  empty iterations with always+thereis would yield T.
o thereis can be used with any other clause, including collect, always etc.

Drawback:
o Some meaning associated to a form previously rejected as ambiguous :)
and which formally, still is ambiguous.
This is precisely why e.g. Bruno Haible rejected a change to CLISP's loop -- which also rejects always+thereis as erroneous -- that I suggested some month ago.

Indeed, the form is still ambiguous from a mathematical POV.
ALWAYS and THEREIS do not really fit together.

Am I sacrificing too much for too little gain?

E.g., my proposed thereis could be rewritten as a macro:
`(let ((,var ,expr)) (if ,var (leave ,var)))
so, when that's needed, the user could do it themselves.

Regards,
	Jorg

Regards,
	Jorg Hohle.



More information about the iterate-devel mailing list