Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f9ac72c09841010b92c255a5cca00521c8992af8
Ticket: b9e1a3032eb1fb7811996bcbdddbeaa8004c589a
TclOO method lookup chooses object method over class mixin method
User & Date: apnadkarni on 2014-07-22 03:39:29
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    The manpage for [next] states in the Method Search Order section that methods defined in classes mixed into classes of an object are searched before methods defined for the object. The following sample seems to show otherwise.
    
    oo::class create ClassMixin {
      method m {} {puts ClassMixin; next}
    }
    oo::class create ObjMixin {
      method m {} {puts ObjMixin; next}
    }
    oo::class create C {
      mixin ClassMixin
      method m {} {puts C}
    }
    
    (tcl) 82 % C create o
    ::o
    (tcl) 83 % oo::objdefine o {mixin ObjMixin}
    (tcl) 84 % info object call o m
    {method m ::ObjMixin method} {method m ::ClassMixin method} {method m ::C method}
    (tcl) 85 % oo::objdefine o {method m {} {puts object; next}}
    (tcl) 86 % o m
    ObjMixin
    object
    ClassMixin
    C
    (tcl) 87 % info object call o m
    {method m ::ObjMixin method} {method m object method} {method m ::ClassMixin method} {method m ::C method}
    
    Again, not sure if the bug is in the docs or the implementation
    
  5. foundin changed to: "8.6.0"
  6. is_private changed to: "0"
  7. login: "apnadkarni"
  8. priority changed to: "5 Medium"
  9. resolution changed to: "None"
  10. severity changed to: "Minor"
  11. status changed to: "Open"
  12. submitter changed to: "apnadkarni"
  13. subsystem changed to: "35. TclOO Package"
  14. title changed to:
    TclOO method lookup chooses object method over class mixin method
    
  15. type changed to: "Bug"