home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / std / cplus / 2001 < prev    next >
Encoding:
Text File  |  1993-01-08  |  1.9 KB  |  42 lines

  1. Newsgroups: comp.std.c++
  2. Path: sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
  3. From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
  4. Subject: Re: Proposal for default scope
  5. Message-ID: <9300817.11209@mulga.cs.mu.OZ.AU>
  6. Sender: news@cs.mu.OZ.AU
  7. Organization: Computer Science, University of Melbourne, Australia
  8. References: <mkohtala.726108774@vipunen.hut.fi> <1993Jan8.044714.2027@qualcomm.com>
  9. Date: Fri, 8 Jan 1993 06:44:03 GMT
  10. Lines: 30
  11.  
  12. greg@qualcom.qualcomm.com (Greg Noel) writes:
  13.  
  14. >In article <mkohtala.726108774@vipunen.hut.fi> Marko.Kohtala@hut.fi suggests
  15. >the use of Class::{ /* ... */ } as syntactic sugar so that class members
  16. >could be defined in the scope without the need to explicitly put the class
  17. >prefix on each member.  He argues that this would make the code easier to
  18. >write and maintain.
  19. [...]
  20. >It does have the disadvantage that it makes the language larger.  On the
  21. >other hand, it would seem to eliminate the desire, expressed by several
  22. >people, for nested functions.  Such nested functions would usually be
  23. >helper functions in the implementation of a class, so by being able to
  24. >expand the class context to include non-nested functions would provide
  25. >an efficient solution.
  26.  
  27. Many people seem to think that the purpose of nested functions is purely
  28. as encapsulation, a sort of code organization/modularization feature.
  29. While it is true that they do support this form of encapsulation, the
  30. real reason that they are useful is their access to parameters and local
  31. variables, and the fact that their addresses can be passed to any function
  32. that just expects a function parameter.
  33.  
  34. If a local function never has its address taken, then it does not use
  35. the full power of nested functions.
  36.  
  37. -- 
  38. Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
  39. This .signature virus is a self-referential statement that is true - but 
  40. you will only be able to consistently believe it if you copy it to your own
  41. .signature file!
  42.