home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / cplus / 13224 < prev    next >
Encoding:
Internet Message Format  |  1992-09-02  |  1.3 KB

  1. Path: sparky!uunet!lax.pe-nelson.com!lax!twbrown
  2. From: twbrown@PE-Nelson.COM (Tom W. Brown)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: GOTO, was: Tiny proposal for na
  5. Message-ID: <600@lax.lax.pe-nelson.com>
  6. Date: 2 Sep 92 20:12:24 GMT
  7. References: <2318@devnull.mpd.tandem.com> <rmartin.715001372@thor> <4192@papaya.bbn.com> <1992Sep2.155510.4274@genghis.borland.com>
  8. Sender: news@lax.pe-nelson.com
  9. Organization: PE-Nelson
  10. Lines: 33
  11.  
  12. In article <1992Sep2.155510.4274@genghis.borland.com>, pete@genghis.borland.com (Pete Becker) writes:
  13. |> 
  14. |> C++ version:
  15. |> 
  16. |> void foo()
  17. |> {
  18. |>     ifstream input( "foo" );
  19. |>     DataObject data;
  20. |>     if( data.doStuff( input ) == ERROR )
  21. |>         return;
  22. |>     data.doMoreStuff();
  23. |> }
  24. |> 
  25. |>     Let the compiler do the work...
  26. |>     -- Pete
  27.  
  28. Tsk, tsk, tsk... You put a return in the middle of the function :-)
  29. How about:
  30.  
  31.    void foo()
  32.    {
  33.       ifstream input("foo");
  34.       DataObject data;
  35.       if (data.doStuff(input) != ERROR)
  36.          data.doMoreStuff();
  37.    }
  38.  
  39.  
  40. ----------------------------------------------------------------------------
  41. Tom Brown               |  "Strange women, lying in ponds, distributing
  42. PE Nelson Systems       |   swords is no basis for a system of government."
  43. twbrown@pe-nelson.com   |                    Monty Python and the Holy Grail
  44. ----------------------------------------------------------------------------
  45.