home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!news.cerf.net!netlabs!lwall
- From: lwall@netlabs.com (Larry Wall)
- Subject: Re: Package & Namespace Question
- Message-ID: <1992Dec17.210221.21875@netlabs.com>
- Sender: news@netlabs.com
- Nntp-Posting-Host: scalpel.netlabs.com
- Organization: NetLabs, Inc.
- References: <BzD4Hw.AG8@da_vinci.it.uswc.uswest.com>
- Date: Thu, 17 Dec 1992 21:02:21 GMT
- Lines: 23
-
- In article <BzD4Hw.AG8@da_vinci.it.uswc.uswest.com> rray@lookout.it.uswc.uswest.com (Randy J. Ray) writes:
- : Why is it that: when calling subroutines defined in the main namespace from
- : within some package, you must explicitly refer to main? Why is there not some
- : syntactical rule that says, "If this routine is not defined at this level,
- : look for it in main before reporting an error"? I can understand specifying
- : &main'phred() when you want to use that instead of a package-defined &phred.
- : Is it that main is not necessarily above other packages in hierarchy, and
- : therefore it is not the natural progression to look for those routines
- : elsewhere?
-
- There is no namespace hierarchy in Perl4. There is likely to be one in
- Perl5, but I think you'd have to explicitly declare something like
- "package main'foo" to place package foo under package main. The
- primary motivation for nesting packages would be to provide inheritance
- of object methods, and I don't see the need offhand for every class to
- derive from package main. If you've got a good reason to do so, now is
- the time to let me know. I may be hubristic, but I'm not proud. :-)
-
- I'll go so far as to claim that in certain fortuitous ways, I'm kinda
- stupid. I'm not particularly proud of being stupid, but that's why Perl
- is understandable to the huddled masses. Call it the Pooh Approach.
-
- Larry
-