iterating over lines in a file

Gareth McCaughan Gareth.McCaughan at pobox.com
Sun Jul 23 12:51:06 EDT 2000


Moshe Zadka wrote:

> > > Preventing world war III, when Python achieves world domination.
> > > If C is allowed to achieve world domination, WWIII will be cause by
> > > 
> > > if(everything_is_ok = 0) {
> > > 	launch_missile();
> > > }
> > 
> > No, that will *prevent* WW3 happening when it was supposed to.
> > Where do I sign up for the campaign to help C dominate the
> > world? :-)
> 
> You probably need to reread the condition.

I don't think so. |everything_is_ok| goes to 0 and
stays there, but that's OK because the missiles
can't get launched on account of the condition
being (apart from the assignment) equivalent to
    if (0) { ... }

Of course, if somewhere else there's a bit of code
like

    if (!everything_is_ok) {
      mobilize_armies();
      invade_nearest_enemy();
    }

then we might get WW3 anyway. :-)

(If your point was that there might be such a piece of
code elsewhere then of course you're right; but I didn't
misread or misunderstand the condition.)

-- 
Gareth McCaughan  Gareth.McCaughan at pobox.com
sig under construction



More information about the Python-list mailing list