Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: &&||



On 20/02/18 12:28 PM, Bart Schaefer wrote:


That was a master class in logic.  Thank you Sensei.

ignored as far as truth tests on the left of any && or ||.
No, that's entirely wrong.  Braces always return the final status of
the enclosed list of statements.  && and || always use the final
status of the entire chain of any && or || to their left.  The two are
related only when the braces surround another chain of && or || but
only in so far as that affects the final status of the braces.
Yes, I get it.  I was asking/expecting the braces to throw decision leftward to the preceding '&&' whereas they properly create a { combined truth test } to be thrown rightward to the following '||'  exactly as they should!

So the fact that one can often set up an &&/|| structure that looks very much like an if/else structure, and the fact that they will very often behave the same way, does not make them logically identical!!  I feel purified of a sin ;-)

Thanks Peter too, I know I flog these things to death.







Messages sorted by: Reverse Date, Date, Thread, Author