# New Ticket Created by Patrick R. Michaud
# Please include the string: [perl #58932]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=58932 >
Sometime after the 0.7.1 release, the P6object library will change
so that double-colons will be treated as separators in class names
passed to the 'new_class' method.
Consider the following code:
.local pmc p6meta
p6meta = get_hll_global 'P6metaclass'
p6meta.'new_class'('Foo::Bar')
Previously this would create a class ['Foo::Bar'] that
would look for its methods in the ['Foo::Bar'] namespace.
At some point after 0.7.1, the above will instead create
a class ['Foo';'Bar'] that looks for its methods in the ['Foo';'Bar']
namespace.
A method that is guaranteed to always bind the new class properly
to the namespace (even for other HLLs) is to pass the namespace
itself as the first parameter to new_class:
.local pmc p6meta, classns
p6meta = get_hll_global 'P6metaclass'
classns = get_hll_global ['Foo';'Bar']
p6meta.'new_class'(classns)
If there is a case where the class name really needs to contain
double-colons, this can be done via a namespace parameter (above)
or by placing the name into an array of some sort:
classns = get_hll_global ['Foo::Bar']
p6meta.'new_class'(classns)
or
$P0 = split(' ', 'Foo::Bar')
p6meta.'new_class'($P0)
Pm