[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl-Toolbox] Re: Handle, Rect, et al



> Something that has bugged me for awhile: we have all of these classes from
> Matthias (God bless his soul :) called Handle, RGBColor, Pattern, Cursor,
> Point, Rect, etc.  What happens if someone makes a module for CPAN called
> Handle?  I know it would break existing code, and I know that it would be
> somewhat hard to do, but I think that we should move to change all of these
> class names.  Maybe just put a Mac:: in front of all of them.  That would
> solve the problem, I think.

I would say put just Mac in front, e.g. "MacHandle"; this makes it
consistent with MacWindow, MacControl, etc. and is easier to type.

> This will probably be even more work for Kevin than it will be for whoever
> works on the modules themselves, so Kevin should weigh in, here.  We
> basically need to weigh the effort to fix against the potential difficulty
> in the future, taking into consideration the fact that the longer we wait,
> the harder it will be to fix in the future.

Thank you for considering me. :)

Also, perhaps leave in a backwards-compatibility component, e.g.:

{
  package Handle;
  use Carp;
  @ISA = 'MacHandle';
  sub new {
    my $self = shift;
    carp "Class @{[__PACKAGE__]} is deprecated; use @ISA instead.";
    $self->SUPER::new(@_);
  }
}

This would even allow easy location of instances of the old name.

-- 
 Kevin Reid: |    Macintosh:      
  "I'm me."  | Think different.

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-toolbox-request@macperl.org