Skip Menu |
 

This queue is for tickets about the base CPAN distribution.

Report information
The Basics
Id: 28581
Status: rejected
Priority: 0/
Queue: base

People
Owner: Nobody in particular
Requestors: rjbs [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: don't push to ISA, set it
Download (untitled) / with headers
text/plain 420b
If I say I want my base class to be X, I don't mean "unless I accidentally already set it somewhere else, in which case make me accidentally use multiple inheritance." I would rather have base-ing a class with ISA be fatal. I don't know if there is a backcompat way to add this and have it not be obnoxious. Perhaps: use base [ 'BaseClass' ]; and see rt 28580: use base [ 'BaseClass' => [ @args ] ]; -- rjbs
Download (untitled) / with headers
text/plain 538b
On Tue Jul 31 08:28:05 2007, RJBS wrote: Show quoted text
> If I say I want my base class to be X, I don't mean "unless I > accidentally already set it somewhere else, in which case make me > accidentally use multiple inheritance." > > I would rather have base-ing a class with ISA be fatal. I don't know if > there is a backcompat way to add this and have it not be obnoxious. > Perhaps: > > use base [ 'BaseClass' ]; > > and see rt 28580: > > use base [ 'BaseClass' => [ @args ] ];
Has this actually bitten you or is it an abstract worry?
Download (untitled) / with headers
text/plain 1.3k
On Sat Aug 11 16:54:36 2007, MSCHWERN wrote: Show quoted text
> On Tue Jul 31 08:28:05 2007, RJBS wrote:
> > If I say I want my base class to be X, I don't mean "unless I > > accidentally already set it somewhere else, in which case make me > > accidentally use multiple inheritance."
---- And you see -- I would want just the opposite. I always push'ed to ISA, since that was the inheritance model that seemed most correct -- i.e. mammal => base for 'dog' dog => base for 'beagle', I'd expect 'beagle to inherit properties from mammal that were not overridden. Doesn't matter if you came along and did a 'use dog', dog would be a subclass of mammal. If you wanted the behavior you specify, you could define your own class 'dog': package tax_collector; use reptile; package joe; use tax_collector; if (can joe->cold_blooded) { print "Joe is cold-blooded\n"; } ... You could do this with use 'base'. You would not as easily be able to do this in standard perl, as it's use statement will read in the disk copy, causing unknown consequences. Somehow this "spooky, at a distance" behavior is considered a feature. I think it would be good if 'base' had adjectives to force it to go to disk. It might, in some cases (perhaps yours), even be preferable for any in-memory class to be purged before reading in a new class, but that might cause other unexpected side effects.
Download (untitled) / with headers
text/plain 322b
Wow, I totally forgot about this ticket. I no longer care about this issue, and am not going to make this mistake anymore. It's documented, I know how it works, and anybody who doesn't should learn from the docs, I suppose. At any rate: I don't need to be told if this issue gets re-raised and worked on. :) -- rjbs


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.