home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / cplus / 18583 < prev    next >
Encoding:
Internet Message Format  |  1992-12-30  |  2.1 KB

  1. Path: sparky!uunet!utcsri!relay.cs.toronto.edu!compuserve.com!76336.3114
  2. Newsgroups: comp.lang.c++
  3. From: 76336.3114@CompuServe.COM (Kevin Dean)
  4. Subject: Standard library functions and macros
  5. Message-ID: <921231032705_76336.3114_EHJ60-1@CompuServe.COM>
  6. Date: 31 Dec 92 03:33:02 GMT
  7. Lines: 37
  8.  
  9. Date: 12-23-92 (20:14)              Number: 3022 of 3071
  10.   To: ALL                           Refer#: NONE
  11. From: JIM ADCOCK                      Read: (N/A)
  12. Subj: STANDARD LIBRARY FUNCTION     Status: PUBLIC MESSAGE
  13. Conf: U-COMPLANGC++ (3870)       Read Type: GENERAL (+)
  14.  
  15. In an article dated 12-23-92, Jim Adcock (jimad@microsoft.com) writes:
  16.  
  17. >I'd counterpropose why don't we all just *leave prior standards alone*
  18. >unless we have overwhelming reasons to change them.  The standard library
  19. >function names in C are reserved.  Leave them reserved, and leave them
  20. >their C "meanings".  There is no more reason why C++ people ought to be
  21. >dinking with these reserved words than any of the other reserved words
  22. >from C, such as "for" "if" "else" "struct" etc.
  23.  
  24. Why should function names be reserved?  They are functions, after all, and
  25. are thus outside the definition of the language.  If they have to be
  26. overridden or defined as macros, can't they just be inlined?  Off the top
  27. of my head, I can only think of the assert() macro that couldn't be
  28. rewritten as an inline function because it has to dump context-sensitive
  29. information like file and line number if it's to be of any use.
  30.  
  31. The reason I say this is that reserving the function names can make for
  32. severe maintenance headaches.  Suppose I have a class that has member
  33. functions read() and write() and the C-standard read() and write() have
  34. been redefined as macros by the compiler.  What then?  The member
  35. functions get replaced by the macros and my class goes out to lunch.  I
  36. have now lost the use of two very useful and meaningful names (I've had
  37. this happen, though not with read() and write()).
  38.  
  39. Kevin Dean
  40.  
  41. SNAG: acronym for Sensitive New-Age Goof, one who, without any relevant
  42. experience, is always willing to enlighten the ignorant masses on the
  43. social issue of the day.  Have you hit any SNAGs lately?
  44.  
  45.  
  46.