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