home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / cplus / 16604 < prev    next >
Encoding:
Text File  |  1992-11-19  |  1.5 KB  |  36 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!munnari.oz.au!sol.deakin.OZ.AU!news.cs.uow.edu.au!cssc-syd.tansu.com.au!pete
  3. From: pete@cssc-syd.tansu.com.au (Peter Alexander Merel)
  4. Subject: Re: Proposal - enhancement for switch statement.
  5. Message-ID: <1992Nov19.211040.20033@cssc-syd.tansu.com.au>
  6. Organization: AOTC - CSSC
  7. References: <1992Nov15.190830.11622@cssc-syd.tansu.com.au> <1992Nov16.150331.11996@ucc.su.OZ.AU>
  8. Date: Thu, 19 Nov 1992 21:10:40 GMT
  9. Lines: 25
  10.  
  11. maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
  12. >
  13. >[the lecture on switch vs. virtuals I'd hoped to avoid]
  14. >
  15. >[an example of an if statement ... gee, thanks :-)]
  16. >
  17. >Pascal did the switch better.
  18.  
  19. I can't agree with this completely. I like being able to fall through 
  20. through cases; it's a clumsy way to do disjunction, I admit, but it's
  21. got an explicit order dependence that you don't get any other way. I
  22. don't use that much (ever?) but I like knowing it's out there, somewhere.
  23.  
  24. >    Doubt it. How about case 1..10: ?? Any chance? Probably not.
  25.  
  26. Certainly not. The advantage I'm trying to get is to be able to use
  27. a switch on types that don't go onto int. You can already use such
  28. types in conditional expressions inside whiles, ifs and fors, by 
  29. virtue of operator==. I just don't see why switch should be left out in
  30. the cold like this; I suspect it's a bit of polymorphism envy from Bjarne.
  31.  
  32. -- 
  33. Internet: pete@cssc-syd.tansu.com.au   UUCP: {uunet,mcvax}!munnari!cssc-syd!pete
  34. Snail: 1/18-20 Orion Road, Lane Cove NSW 2066 Australia    Phone: +61 2 911 3130
  35. I am a big pond in a small fish.
  36.