Artifacts Associated With Ticket 2200824fffffffffffffffffffffffffffffffff
Ticket change [d326098e58] (rid 113648) by cnassau on 2008-10-27 13:55:12:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
I've been playing around with the [otherwise wonderful] new oo package and stumbled across some namespace issues that I find rather inconvenient. The following code works as it stands, but breaks if it is moved into a namespace: oo::class create fruit {} oo::class create banana { superclass fruit } If this is evaluated in namespace mynsp the superclass statement needs to be changed: namespace eval mynsp { oo::class create fruit {} oo::class create banana { # superclass fruit ;# <- should work superclass mynsp::fruit ;# does work } } I currently see no [non-convoluted] way to avoid the hardcoded reference to the mynsp-namespace in this superclass statement. The reason seems to be that oo::class evaluates its script in the oo::define namespace. Wouldn't it be better to extend the "namespace path" of oo::define during the execution of the definer script with the namespace path of the current namespace? Variable resolution is troubled by the same dilemma: the code namespace eval mynsp { set bar baz oo::class create foo { method $bar args {} } } fails most of the time, because $bar currently resolves to $::bar rather than $mynsp::bar. I would most humbly suggest to review these resolution rules again. - foundin initialized to: "obsolete: 8.6a3"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "cnassau"
- subsystem initialized to: "35. TclOO Package"
- title initialized to: "awkward namespace behaviour"
- type initialized to: "Bug"
Ticket change [0ff8c44160] (rid 94886) by dkf on 2008-10-27 22:44:00:
- priority changed to: "7 High"
Ticket change [8f935815f0] (rid 120296) by dkf on 2008-10-31 22:15:59:
- icomment:
Agreed that this is an issue. Not yet quite sure how to fix neatly. Hmmm....
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [0c16f613c6] (rid 114116) by dkf on 2008-11-01 05:11:27:
- icomment:
Fixed in Tcl HEAD. Needs backport. Note that the fix for this is quite involved, because it otherwise breaks the error traces out of class constructors. Fixing *that* requires defining a command that is a combination of [uplevel] and [catch] and which also suppresses errors a bit more too. Tricky stuff!
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- username: "dkf"
- icomment:
Ticket change [dec6801251] (rid 114909) by dkf on 2008-11-01 07:38:24:
- closedate changed to: "2008-11-01T00:38:24"
- closer changed to: "dkf"
- icomment:
Backported
- login: "dkf"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "dkf"