On Jan 31, 2008 9:08 PM, Nils Bruin <[EMAIL PROTECTED]> wrote:
>
> OK, I changed the patch on http://trac.sagemath.org/sage_trac/ticket/1987
> so that "forall" and "exists" do not change functionality, but have a
> pointer to "all" and "any" in their docstrings. Incidentally, it is
> *crucial* to *not* use square brackets inside any and all. If you do,
> you destroy any possible "short circuit evaluation".
>
> sage: all(a %2 == 0 for a in ZZ) #terminates quickly
> False
> sage: all([a %2 == 0 for a in ZZ]) #blows up
>

Any chance you could also post a patch that adds this very important
insight to the documentation?

Also, in your posted patch you emphasize that forall and exists
are *NOT* suitable for use in an if, etc.  I would have written that
to use them thus you have to use the ugly forall(...)[0], and it is
much nicer to use all(...) and any(...).

William

William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to