Overview
| Artifact ID: | d326098e58421f2ffb4dd16e7b1974e83a776eb8 |
|---|---|
| Ticket: | 2200824fffffffffffffffffffffffffffffffff
awkward namespace behaviour |
| User & Date: | cnassau on 2008-10-27 13:55:12 |
Changes
- assignee changed to: "dkf"
- cmimetype changed to: "text/plain"
- comment changed 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 changed to: "obsolete: 8.6a3"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "cnassau"
- subsystem changed to: "35. TclOO Package"
- title changed to: "awkward namespace behaviour"
- type changed to: "Bug"