|
Technology Computing, programming, science, electronics, telecommunications, etc. |
|
Thread Tools | Display Modes |
11-29-2010, 12:52 PM | #31 | |
Snowflake
Join Date: Mar 2006
Location: Dystopia
Posts: 13,136
|
Quote:
!(a) where (a) is a bool function evaluates true or false, it doesn't literally execute the function. Really, it doesn't. It doesn't do that. Really.
__________________
****************** There's a level of facility that everyone needs to accomplish, and from there it's a matter of deciding for yourself how important ultra-facility is to your expression. ... I found, like Joseph Campbell said, if you just follow whatever gives you a little joy or excitement or awe, then you're on the right track. . . . . . . . . . . . . . . . . . . . . . . . . . . Terry Bozzio |
|
11-29-2010, 01:56 PM | #32 | |
I think this line's mostly filler.
Join Date: Jan 2003
Location: DC
Posts: 13,575
|
You are wrong. The 'true' or 'false' that a() evaluates to is the one that is returned in the body of the function as it executes. I don't know where you think that value comes from if it doesn't come from the execution of the function.
Try this: Add a second parameter to a() and b(), and pass in a unique value to each call. At the beginning of a() and b(), print out that value. Quote:
__________________
_________________ |...............| We live in the nick of times. | Len 17, Wid 3 | |_______________| [pics] |
|
11-29-2010, 02:57 PM | #33 |
Snowflake
Join Date: Mar 2006
Location: Dystopia
Posts: 13,136
|
Everything that you've said was supposed to happen (posts #8, 13, 15, 19, 25) doesn't happen. I don't see how showing you another example that doesn't happen will be more convincing than the overwhelming evidence I've already presented.
__________________
****************** There's a level of facility that everyone needs to accomplish, and from there it's a matter of deciding for yourself how important ultra-facility is to your expression. ... I found, like Joseph Campbell said, if you just follow whatever gives you a little joy or excitement or awe, then you're on the right track. . . . . . . . . . . . . . . . . . . . . . . . . . . Terry Bozzio |
11-29-2010, 05:51 PM | #34 |
I think this line's mostly filler.
Join Date: Jan 2003
Location: DC
Posts: 13,575
|
It will happen.
I withdrew my predictions from 8 and 13 already. I don't think you've tested whether the things I've said were supposed to happen in 15, 19, and 25 are happening. They wouldn't affect what you see in your normal execution, just what is happening behind the scenes. As I said, the while loop is correcting for the strange behavior of the functions, and it seems to me that all of the overwhelming evidence you have presented includes the while loop. If you test the functions alone, not in a while loop, you can see the side effects: main() { cin.getline(pw) if (a(pw)) cout << "a returned true, pw is now " << pw << endl; else cout << "a returned false, pw is now " << pw << endl; } If you enter a bad password, it will ask for another. If you enter another one, it will return false, even if the second one was good.
__________________
_________________ |...............| We live in the nick of times. | Len 17, Wid 3 | |_______________| [pics] |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|