Skip to content
Tcl Source Code History Of Ticket 2200824
Login

History Of Ticket 2200824

Artifacts Associated With Ticket 2200824

  1. Ticket change [d326098e58] (rid 113648) by cnassau on 2008-10-27 13:55:12:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. 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.
      
    4. foundin initialized to: "obsolete: 8.6a3"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "cnassau"
    10. subsystem initialized to: "35. TclOO Package"
    11. title initialized to: "awkward namespace behaviour"
    12. type initialized to: "Bug"
  2. Ticket change [0ff8c44160] (rid 94886) by dkf on 2008-10-27 22:44:00:

    1. priority changed to: "7 High"
  3. Ticket change [8f935815f0] (rid 120296) by dkf on 2008-10-31 22:15:59:

    1. icomment:
      Agreed that this is an issue. Not yet quite sure how to fix neatly. Hmmm....
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  4. Ticket change [0c16f613c6] (rid 114116) by dkf on 2008-11-01 05:11:27:

    1. 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!
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. resolution changed to: "Fixed"
    5. username: "dkf"
  5. Ticket change [dec6801251] (rid 114909) by dkf on 2008-11-01 07:38:24:

    1. closedate changed to: "2008-11-01T00:38:24"
    2. closer changed to: "dkf"
    3. icomment:
      Backported
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "dkf"