On Wed, 30 Jul 2003, Stas Bekman wrote:
> +1 on the patch
>
> Randy, whatever you think is the best for win32, please go
> ahead with it. Untill we get someone else on win32 involved,
> you are pretty much free to decide how to handle things and
> what's the best for the user, as long as the changes don't
> break the code on other platforms. It's really hard to judge
> what's good or less good without seeing the problem. Perhaps
> somebody else can do that. I remember Philippe was trying to
> set win32 env, but he is now in transition from one continent
> to another...
>
> On the other hand, I really dislike the fact that the code gets
> too many conditionals, making it much harder to comprehend. We
> should consider to use subclasses for win32 (or any other
> platform that requires too many special cases). What do you
> think? There is no hurry for now, but we should keep it at the
> backs of our heads (unless of course you think it's a cool idea
> and want to go with it right now ;). The good thing is once
> subclassed, there is very little danger that the code on other
> platforms will go broken.
You're right that there's getting to be too many conditionals
in places, and subclassing would be a better way to go ...
I'll take a look at that, but I'm going on a bit of a break
in a couple of days - what about for now, doing something like
ModPerl::Build does: have, for some sub
sub whatever {
my $self = shift;
my $what = \&{"whatever_$^O"};
$what = \&whatever_default unless defined &$what;
$what->($self);
}
sub whatever_default {
....
}
and then, to add something special for MSWin32, simply define a
sub whatever_MSWin32 {
...
}
which gets used in place of the default. I could redo that
patch in this form easily, if that would be better for now.
--
best regards,
randy