"short circuiting" And and Or
- To: mathgroup at smc.vnet.net
- Subject: [mg70582] "short circuiting" And and Or
- From: "Szabolcs Horvat" <szhorvat at gmail.com>
- Date: Fri, 20 Oct 2006 05:21:49 -0400 (EDT)
I'd like to write a function that tests whether there are any elements in a list that violate a certain condition. I could simply use And@@condition/@list, but for reasons of efficiency I'd like to stop the testing as soon as a "False" value is found. Is there any elegant way of doing this without writing an explicit While loop? Szabolcs Horvát
- Follow-Ups:
- Re: "short circuiting" And and Or
- From: Carl Woll <carlw@wolfram.com>
- Re: "short circuiting" And and Or
- From: János <janos.lobb@yale.edu>
- Re: "short circuiting" And and Or
- From: Sseziwa Mukasa <mukasa@jeol.com>
- Re: "short circuiting" And and Or
- From: Carl Woll <carlw@wolfram.com>
- Re: "short circuiting" And and Or
- From: "Chris Chiasson" <chris@chiasson.name>
- Re: "short circuiting" And and Or