Re: for conditional handling question



sandeep wrote:
) Eric Sosman writes:
)> In other words, a "for" statement does:
)>
)> 1: If `e1' is present, evaluate it. (And bring into existence
)> any variables it happens to declare These variables live as
) long as
)> the loop is executing, and cease to exist when it terminates
) for any
)> reason.)
)>
)> 2: If `e2' is present, evaluate it. If it evaluates to zero,
)> terminate the "for" and skip to whatever follows the body.
)
) I believe it is more correct to say that e1 and e2 are evaluated whether-
) or-not they are empty. It just happens that evaluating an empty
) expression has no effect and yields a TRUE value.

You believe wrongly. As an example:

if () { /* something */ }

The ability to not have expressions is quite specific to for-loops.


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
.



Relevant Pages

  • Re: for conditional handling question
    ... (And bring into existence ... any variables it happens to declare These variables live as ... It just happens that evaluating an empty ...
    (comp.lang.c)
  • Re: Possible hack? Logs clear & syslogd restarted...need help!
    ... >> Is there a reason why these are clear? ... I never empty these manually. ... > logrotate which said since it is Sunday, ... it...guess i was a little paranoid. ...
    (comp.os.linux.security)
  • Re: Post they want back
    ... it, crack you in the mouth, hold onto you while three others empty ... your house. ... so I doubt he'll be opening up at night time. ... I'm not paranoid, I just don't want to give them a chance. ...
    (uk.media.tv.misc)
  • Re: empty variables - getting rid of "uninitialized value" warnings?
    ... Tomasz wrote: ... I have perl code which should do some action only if: ... Don't print of the above is empty. ... You all think I'm paranoid, ...
    (comp.lang.perl.misc)
  • Unbound Text Box Value
    ... What is the initial value of an unbound text box? ... I have tried evaluating for ... Is Empty and "" but these don't seem to be true. ... Prev by Date: ...
    (microsoft.public.access.modulesdaovba)