home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / perl / 7578 < prev    next >
Encoding:
Text File  |  1992-12-22  |  1.7 KB  |  44 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!uunet.ca!cognos!alanm
  3. From: alanm@cognos.com (Alan Myrvold)
  4. Subject: Re: Package & Namespace Question
  5. Message-ID: <1992Dec22.153015.26706@cognos.com>
  6. Keywords: package, inheritance, perl 5
  7. Organization: Cognos Incorporated, Ottawa CANADA
  8. References: <BzD4Hw.AG8@da_vinci.it.uswc.uswest.com> <1992Dec17.210221.21875@netlabs.com> <163@eiffel.eiffel.com>
  9. Date: Tue, 22 Dec 1992 15:30:15 GMT
  10. Lines: 32
  11.  
  12. In article <163@eiffel.eiffel.com> ram@eiffel.com (Raphael Manfredi) writes:
  13. >I believe it is a desirable property to have all the classes (packages)
  14. >inherit from one root class (package main), since the root class is the
  15. >only possible repository for basic features which need to be seen by all
  16. >the user-defined classes.
  17. ...
  18. >Now, did I do a good job in convincing you?
  19.  
  20. No.
  21.  
  22. If class foo inherits from main, then presumably the function call
  23. &foo'bar, or the variable $foo'baz, if not defined in package foo,
  24. will refer to &main'bar or $main'baz.
  25.  
  26. This is wrong, given the way most people use packages.  Most perl programs
  27. are fairly small, and clutter main' with variables and subroutines.  When
  28. that clutter gets too messy, packages can be used to segregate the namespace.
  29.  
  30. If $main'baz and $foo'baz refer to the same thing, then there is no namespace
  31. segregation.
  32.  
  33. And please, the pollution of namespace that Eiffel inheritance brings, and the
  34. rename subclause that kludges a workaround have no place in the Perl package
  35. system!
  36.  
  37. Perl is a different language, and deserves none of the defects of Eiffel.
  38.  
  39. ---
  40. Alan Myrvold          3755 Riverside Dr.    
  41. Cognos Incorporated   P.O. Box 9707          alanm@cognos.com
  42. (613) 738-1440 x3317  Ottawa, Ontario       
  43.                       CANADA  K1G 3Z4       
  44.