#389: subs with :method should not be entered as symbols in the namespace
----------------------+-----------------------------------------------------
Reporter: pmichaud | Owner: allison
Type: bug | Status: assigned
Priority: critical | Milestone:
Component: core | Version: trunk
Severity: high | Keywords:
Lang: perl6 | Patch: new
Platform: |
----------------------+-----------------------------------------------------
Comment(by coke):
This branch fails for partcl because {{{.sub}}}s declared with :method
aren't invokable as methods on the object.
{{{
$ ./tclsh
Method 'getListValue' not found for invocant of class 'TclString'
$ ack :method src/class/tclstring.pir
.sub getListValue :method
.sub getDictValue :method
}}}
I pretty much universally use this method as:
{{{
foo = foo.'getListValue'() # insure arbitrary PMC can be used as a list.
}}}
I'm not (intentionally) relying on the namespace here at all. (if I add
:nsentry here, this error goes away. However, I cannot make it go away for
the method I'm attempting to add to the core String that I'm using.)
However, I read this right, I shouldn't have to be adding nsentry, since
I'm not expecting it to be in the namespace anyway.
I would also argue that the proper way to do introduce this that allows
people to adopt it painlessly would be:
* provide a way to override the default with the desired new behavior.
(e.g. :no_nsentry)
* provide a way to explicitly declare you want the default behavior (e.g.
:nsentry)
* With the next release, declare that the old default will change after
the release after that.
This allows users to update their code in advance and have it keep working
when the default changes; it also allows users to adopt the new behavior
asap.
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/389#comment:15>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets