Re: year not returned by Time::localtime
- From: "SteveP" <teban@xxxxxxxxxxx>
- Date: 31 May 2006 00:14:53 -0700
DJ Stunks wrote:
SteveP wrote:
If it
returns an object, then the parser should be able to disambiguate the
appropriate method returning a list when appropriate or using an object
when the lval type is appropriate. The documentation does not use the
word overload instead using the word override. If the designer's intent
were to discourage the use of the list return for the OO interface,
then I would have recommended choosing a different name for the
function or to extend the conventional API.
ah, yes, we're saying the same thing. the constructor should be called
new().
new has a special meaning in C++ and Java but that's not what you mean
is it? Also constructor has a special meaning in OO languages also
relating to the use of the new keyword. I'm not familiar with the
internals of perl regarding memory management and hence the distinction
between heap variables and stack (auto) variables. Heap variables
require constructors and destructors or garbage collection. Perls
treatment of arrays as dynamically resizeable objects is special but I
don't think of perl as a language appropriate for long-lived
applications since memory management would surely be problematic.
Instead I suspect that you mean that the new package function should be
given a unique identifier but if not then kindly point me at something
to read as this is something "new" to me. (pun semi-intended)
also, I think 'override' and 'overload' are synonymous. someone else
can correct me if there's a slight semantic difference...
In C++ an override method entirely replaces a previous method with a
different one of the same name and argument & return types. An
overloaded operator or overloaded method introduces a new method of the
same name but with different number of arguments or different argument
types. Its not possible to disambiguate (identify the appropriate
method) based upon return type in C++ although (I believe) perl does
this.
The "use" keyword seems to have global file level applicability rather
than line by line state similar to the way the "use" keyword is used in
Ada. Other documentation says that perl needs to know the state of the
current package to determine the scope of names; I am confused! Is
there a way to say "use ~nothing at all~"?
I'm not clear on what you're asking. To use nothing, don't include a
use statement :P (besides use strict that is!)
Apparently neither am I. ;-p
In Ada, when we use a package in the declaration section of a block,
the scope of use is over the entire block and ends at the end of the
block. You can't sprinkle additional use statements intermixed with the
procedural section of the block to change the meaning of symbols within
the block.
In perl, a use statement can appear anywhere. So does it only apply to
symbols later in the file? If another use statement appears can it undo
the effects of a previous use or merely override or take precendence
over an symbol that appears in both packages? The perl documentation
refers to a current package so I presume that there is only a single
current package and the state of the current package can change from
line to line depending upon the use statements encountered? Or maybe
I'm all mixed up and current package just means the package we have
declared (or main::) and has nothing whatsoever to do with the use
state.
I think maybe I just have to read my perl book for a few days or
something. By the time I can explain it without confusing you, I
probably won't be confused anymore. ;-p
Steve
.
- References:
- year not returned by Time::localtime
- From: SteveP
- Re: year not returned by Time::localtime
- From: DJ Stunks
- Re: year not returned by Time::localtime
- From: SteveP
- Re: year not returned by Time::localtime
- From: DJ Stunks
- Re: year not returned by Time::localtime
- From: SteveP
- Re: year not returned by Time::localtime
- From: DJ Stunks
- year not returned by Time::localtime
- Prev by Date: sorting?
- Next by Date: regex matching
- Previous by thread: Re: year not returned by Time::localtime
- Next by thread: PERL-CGI to pass a file to multiple server
- Index(es):
Relevant Pages
|