Skip to content
Tcl Source Code History Of Ticket 3485060fffffffff
Login

History Of Ticket 3485060fffffffff

Artifacts Associated With Ticket 3485060fffffffff

  1. Ticket change [f68c3d3949] (rid 130322) by basilik99 on 2012-02-06 19:28:27:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Hi,
      
      I use ActiveState Tcl 8.6.0.0.295132 Beta 6. The following code:
      
      package require TclOO
      oo::class create Mix1 \
      {
         variable Mix1_var
         
         constructor {} \
         {
            set Mix1_var 10
            puts "Mix1 constructor: Mix1_var = $Mix1_var."
            next
         }
      }
      
      oo::class create C1 \
      {
         mixin [oo::copy Mix1 Mix1_copy]
         
         variable C1_var
         
         constructor {} \
         {
            set C1_var 40
            my variable Mix1_var  ;# needed otherwise variable not found (normal behavior)
            puts "C1 constructor: C1_var = $C1_var and Mix1_var = $Mix1_var."
         }
      }
      C1 create objc1
      
      
      gives the output:
      
      Mix1 constructor: Mix1_var = 10.
      can't read "Mix1_var": no such variable
      % puts $errorInfo
      can't read "Mix1_var": no such variable
          while executing
      "puts "C1 constructor: C1_var = $C1_var and Mix1_var = $Mix1_var.""
          (class "::C1" constructor line 4)
          invoked from within
      "next"
          (class "::oo::define::Mix1_copy" constructor line 4)
          invoked from within
      "C1 create objc1"
      
      However, if:
      mixin [oo::copy Mix1 Mix1_copy]
      is replaced by:
      mixin Mix1
      
      then it works without an error. So I suspect variables in a mixin not being copied when the mixin class is copied. Please confirm if it is a bug.
      
      Thanks,
      Etienne
      
    4. foundin initialized to: "None"
    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: "basilik99"
    10. subsystem initialized to: "35. TclOO Package"
    11. title initialized to: "TclOO: variables not copied when mixins are copied"
    12. type initialized to: "Bug"
  2. Ticket change [be92c4b724] (rid 102092) by dkf on 2012-02-13 07:18:16:

    1. icomment:
      
      
      File Added - 435627: 3485060.patch
      
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  3. Add attachment "3485060.patch" [7660fb98f8] (rid 105579) by dkf on 2012-02-13 07:18:16.

  4. Ticket change [948eca4e01] (rid 106004) by dkf on 2012-02-13 07:24:47:

    1. icomment:
      Try the attached patch (or look on the development-rfe3485060 of the tcloo project: http://core.tcl.tk/tcloo/) which should now copy variables and procedures. I'd appreciate review; there may be things that should be copied by default which I've forgotten. (Note that non-procedure commands and sub-namespaces will definitely _not_ be copied by default, the former because that's super-hard and the latter because there's now a mechanism for adding it when necessary. I also don't copy traces of any kind.)
      
      It's *possible* that the patch won't apply cleanly to the main Tcl 8.6 trunk right now (well, excluding the ChangeLog entry of course). The codebases are close, but not identical.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  5. Ticket change [74e88e13c7] (rid 105298) by dkf on 2012-03-27 15:28:15:

    1. closedate changed to: "2012-03-27T08:28:15"
    2. closer changed to: "dkf"
    3. foundin changed to: "obsolete: 8.6b2"
    4. icomment:
      
      
      allow_comments - 1
      
      Fixed with commit of TIP #397 implementation,
      
      
    5. login: "dkf"
    6. mimetype: "text/plain"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"
    9. username: "dkf"