[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Packages and cons
From: |
Gary Oberbrunner |
Subject: |
RE: Packages and cons |
Date: |
Wed, 18 Jul 2001 11:10:21 -0400 |
Johan Holmberg wrote:
>
> Isn't this just a complicated way of doing, what could easier be
> written like this:
>
> Construct file:
>
> use Mystuff;
>
> $CONS = new cons;
> $CONS->printhi; # call new method
Yes, if you're willing to call all your 'utility' functions as methods, like
$CONS->printhi. Since most of my utility functions don't require an
environment (they're what would in C++ be "static" methods), I'd prefer to
call them as bare functions, e.g. "printhi();". So I prefer the solution
Johan and Frank suggested, which is to turn my Cons-subs.pl into ConsSubs.pm
(by the way, it seems module names can't have hyphens in them?) and 'use
ConsSubs' in each of my Construct/Conscript files.
It also does make sense to me that you can now look at any given Conscript
file and see where it's getting those method definitions. Nothing's
"invisibly" imported from anywhere. For the tiny amount of extra work, the
clarity is worth it.
Thanks all -- I really appreciate all the helpful comments from this list!
-- Gary Oberbrunner
- RE: Packages and cons, (continued)
- RE: Packages and cons, Jeff Rosenfeld, 2001/07/17
- RE: Packages and cons, Gary Oberbrunner, 2001/07/17
- RE: Packages and cons, Gary Oberbrunner, 2001/07/17
- Re: Packages and cons, Frank Thomas, 2001/07/18
- Re: Packages and cons, Johan Holmberg, 2001/07/18
- Re: Packages and cons, Frank Thomas, 2001/07/18
- Re: Packages and cons, Johan Holmberg, 2001/07/18
- Re: Packages and cons, Frank Thomas, 2001/07/18
- Re: Packages and cons, Wayne Scott, 2001/07/18
- Re: Packages and cons, Johan Holmberg, 2001/07/18
- RE: Packages and cons,
Gary Oberbrunner <=