Subj : Re: Categories? resume references? (was: How much should I charge f...) To : comp.lang.lisp,comp.programming,comp.lang.java.programmer From : blmblm Date : Sun Sep 04 2005 07:31 pm In article , Robert Maas, see http://tinyurl.com/uh3t wrote: >> From: "David" [ snip ] >Here's a more interesting, and C++ specific, riddle, which I managed to >solve after both my current-at-the-time C++ instructor and my previous >C instructor were both stumped by it (and I was stumped until I finally >read the key information later in the textbook that gave me the clue I >needed to solve the riddle and explain it to my instructors): How is it >that cin can be chained, yet cin can be used as a boolean to test for >EOF? Is the value of cin boolean, true or false depending on EOF or >not, or iostream, *always* returns itself, never returns a false >value?? The answer to the riddle is one of the reasons C++ is an >inscrutably more perverse language than just about any other language, >making it impossible to understand even one line of code sucn as a >simple C-syntax IF statement without knowing the entire rest of the >program simultaneously. Do you want me to tell you the answer now, or >do you want to try guessing first? To avoid one person telling the >answer and the other claiming to already know it when in fact he >didn't, I suggest we use an incremental-info-exchange protocol. Are you >familiar with the "tell me something I don't already know" problem with >information barter, and the incremental-info-exchange solution? Well, I think I understand in general terms why one can write, for example, while (cin << data_item) but apparently you'd prefer people not post explanations just yet, so I won't. What I *am* curious about is what this has to do with needing to know the rest of the program to understand a single line; i.e., what makes you say this: >The answer to the riddle is one of the reasons C++ is an >inscrutably more perverse language than just about any other language, >making it impossible to understand even one line of code sucn as a >simple C-syntax IF statement without knowing the entire rest of the >program simultaneously. [ snip ] -- | B. L. Massingill | ObDisclaimer: I don't speak for my employers; they return the favor. .