Ken Williams wrote:
On Jan 22, 2007, at 11:25 AM, Sendu Bala wrote:
I'm not sure that particular warning to 'fancy developers' makes much
sense. At least not to me, and I suppose its directed specifically at me.
I didn't mean to direct it at you - I wasn't even considering your case,
in which fancy stuff gets inadvertently put in.
In fact the creation of _build/prereqs is slightly magical; I never
even realised the file was being created. Instead you ought to warn
people not to mess with the data structure of
$self->{properties}->{requires}.
Yeah, and we could even back it up with a runtime check when we write
the prereqs file, to make sure the structure is what we expect. That
would help fancy people like you, wouldn't it? =)
Ideally there would be an explicit method that M::B calls for itself
when it wants to create _build/prereqs. That way if a fancy developer
messed with $self->{properties}->{requires} he would just be able to
override that method, turning $self->{properties}->{requires} back into
the normal format for the duration of that call. The method would also
then be normally documented and it would be very clear what was
expected; rather than searching all the documentation for one random
note about what not to do.
But, just to be clear, such a thing isn't important to me at least: I no
longer mess with[*] $self->{properties}->{requires}. Just suggesting
what seems most appropriate to me if I did.
* Well, I don't mess with the data structure. I certainly add key-value
pairs to it, and my values might at some point during execution not just
be version numbers.