> * Pascal J.Bourguignon <cwo@...> [2004-10-23 21:00:48 +0200=
> *** - LOOP: ambiguous result of loop=20
> (LOOP FOR SUBFORM =3D (CAR SUBFORM-CONS) WHILE SUBFORM-CONS NEVER (ATOM S=
> THEREIS (EQUAL SUBFORM '(TL:GO TL::NEXT-LOOP)) DO
> (SETF SUBFORM-CONS (CONS-CDR SUBFORM-CONS)))
> =C2=A0Break 1 TLI>=20
> Here is what CLHS says about always, never and thereis:
> always: Otherwise, it provides a default return value of t.=20
> never: Unless some other clause contributes a return value, the
> default value returned is t.
> thereis: Unless some other clause contributes a return value, the
> default value returned is nil.
> So, the result specified by never and thereis seem to be in
> contradiction, but these clauses are not evaluated in parallel!
suppose neither NEVER nor THEREIS ever trigger.
what is to be returned? T or NIL?
Or would you require us to analyze all FINALLY statements for presence
of non-local returns?
specifically, what would you like this to return:
(loop :for i :from 1 :to 10 :thereis nil :never nil)
LW returns T.
CMUCL issues a warning and returns T.
I think the CLISP approach is the safest and the cleanest.
If you disagree, please raise the issue on c.l.l and see what the other
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
There is an exception to every rule, including this one.