David Brunton wrote:
Aaron Sherman wrote: <replies snipped />

IMHO, the golden rule of programming languages should be: if you
need a namespace, create one.

Is there any reason these "meta" methods could not be part of some
default function package like Math::Basic and Math::Trig?  The
package could be called Class::InterrogativePronouns, or
Object::MetaModel, or ProgrammingLanguage::Pollution.  And it could
be loaded by default.  Or not.  That decision is far above my
paygrade.

[...]

Does anyone else have thoughts on this they'd be willing to share?


Let me see if I understand. You are essentially asking, "why are these metaish things special? Why aren't they just coming from a namespace like everything else?"

The reason is two-fold (and they're good reasons):

1. The object system is built using these tools, so you cannot build them using the object system without doing some very ugly kludging and bootstrapping which we already have enough of to do.

2. As Larry points out in his documentation that you may or many not have noticed he updated yesterday, these will be macros, and thus cannot be dispatched at runtime.

Thus they MUST bypass the dispatch that the user might be expecting to happen. The choices are thus:

* Let that override part of the user namespace (with workarounds that Larry has suggested) or,

* Create some unique way to say "we're doing the metaish thing here, not dispatch." That was the idea of $obj\.meta or $obj.*meta or whatever.

Larry seems to have made up his mind, and while I don't agree that his is the best choice, sometimes making a choice is more important than agreeing that it was the best one. Consensus is screwy that way ;)

Someone who is Larry should probably speak up if that doesn't make any sense.

Reply via email to