On Sat, May 05, 2001 at 01:10:52PM -0400, John Siracusa wrote:
> This problem already exists to some degree in Perl 5. Stuff like isa() and
> can() is already squatting in the lowercase "user method" namespace. But I
> have a feeling that properties will multiply a lot faster than UNIVERSAL
> methods, so the opportunity for conflict seems even greater.
> One possible solution it so make all built-in properties UPPERCASE:
Good thinking.
This also led me to think about what happens when we introduce new built-ins.
Perl 5 has had a complete built-in freeze for a long long time now because
you can't bring in a new built-in without risking smacking subroutines in
old code.
We can get around that in Perl 6 by reversing the precedence: let user-defined
subroutines and methods take priority over built-ins. This would allow for
easy overloading ("sub open { ... }") and give us forward-compatibility. (If
you want to be sure you're working with built-in open, just use CORE::open)
Maybe something similar for properties.
--
"He was a modest, good-humored boy. It was Oxford that made him insufferable."