[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: protected.pm (more Class::Fields)



Hi,

Sam Tregar:
> Basically: why doesn't Bar->new() somehow magically call Foo->new() before
> it runs its code?
>
Because we have multiple inheritance and it's not always clear which
new() to call, if any. Because Foo->new() might require different 
arguments than Bar->new(). Because it would 

>  I mean, what does inheritence mean if it doesn't mean
> that you can "cast" a Bar into a Foo with no problems?
> 
Inheritance doesn't work for directly accessing data objects in Perl,
simply because Perl has more than one kind of object.

If you want it to, create a bunch of accessor functions.

-- 
Matthias Urlichs  |  noris network GmbH   |   smurf@noris.de  |  ICQ: 20193661
The quote was selected randomly. Really.    |      http://www.noris.de/~smurf/
-- 
The tendency of all strong Governments has always been
to suppress liberty, partly in order to ease the processes
of rule, partly from sheer disbelief in innovation.
                        -- J. A. Hobson (1858-1940)


[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]