Re: Perl Object Creation problem...




Tad McClellan 寫道:

howa <howachen@xxxxxxxxx> wrote:

lawre...@xxxxxxxxxxxxxxxxxxx ???

"howa" <howachen@xxxxxxxxx> writes:

it seems a little stupid if the class name must be the package full
name...


Perhaps this will offer enlightenement:

Suppose I have two classes Road::Apple and Fruit::Apple

#/usr/local/bin/howas-private-perl-like-language
use Road::Apple;
use Fruit::Apple;

my $thing = new Apple;

What kind of apple whould $thing be?


I don't think that was a rhetorical question, but you did not
address it.

What kind of apple whould $thing be?


One is delicious, the other not
so much.


[snip .sig, you are not supposed to quote those you know]


in other language, you also have this problem, java or c.
^^^^

What is with the "also" there?

Perl does not have that problem.


in fact, this is not a problem at all,


Then what kind of apple whould $thing be?

A red one or a brown one?

If the programmer cannot tell, then it looks like a problem to me...


--
Tad McClellan SGML consulting
tadmc@xxxxxxxxxxxxxx Perl programming
Fort Worth, Texas

did you even have experience on java or c? (no offense)

how they handle namespace/package/import/include ?

of coz perl has more then one way to do it, but seems the way how perl
handle it is not a good solution.

.



Relevant Pages

  • Re: Perl Object Creation problem...
    ... it seems a little stupid if the class name must be the package full ... Perhaps this will offer enlightenement: ... What kind of apple whould $thing be? ...
    (comp.lang.perl.misc)
  • Re: Perl Object Creation problem...
    ... it seems a little stupid if the class name must be the package full ... Perhaps this will offer enlightenement: ... What kind of apple whould $thing be? ...
    (comp.lang.perl.misc)
  • Re: Perl Object Creation problem...
    ... What kind of apple whould $thing be? ... Perl does not have that problem. ... given a problem that could affect many languages the solution depends on the language and it might even be that the problem disappears for some language... ... via one of the alias modules on CPAN ...
    (comp.lang.perl.misc)
  • Re: Perl Object Creation problem...
    ... it seems a little stupid if the class name must be the package full ... Perhaps this will offer enlightenement: ... What kind of apple whould $thing be? ...
    (comp.lang.perl.misc)