Chip Salzenberg <[EMAIL PROTECTED]> wrote:
On Sat, Jul 01, 2006 at 12:22:56AM -0700, [EMAIL PROTECTED] wrote:
> Another FAILING namespace test:
> $P0 = new .ResizableStringArray
> $P0[0] = ''
> $P1 = get_namespace $P0
I think I (or the pdd) may have been misunderstood:
The get_namespace opcode currently accepts keys (and strings).
The compiler.'get_namespace'() method accepts arrays.
So unless I've missed something in the purpose of your test, it's testing
behavior that Parrot isn't trying to provide.
At the top of the pdd:
- Add a get_namespace opcode (that takes an -->array<-- or a multidimensional
hash index)
A bit further down:
=item $P0 = get_namespace $P1
=item $P0 = get_namespace
Get the namespace $P1 (an -->array<-- of names or a
multidimensional hash index) or
the current namespace. To get the "Foo::Bar" namespace, one would use this:
$P0 = split "::", "Foo::Bar"
$P1 = get_namespace $P0
It's definitely in the pdd; even the example here uses arrays (not too
surprising, since I wrote it. ;-). Arrays are the easiest way to be
able to get a namespace at runtime... which translates to the easiest
way for Tcl to use namespaces.
--
matt diephouse
http://matt.diephouse.com