Skip to content
Tcl Source Code History Of Ticket 9d0cfbc51e3b6281
Login

History Of Ticket 9d0cfbc51e3b6281

Artifacts Associated With Ticket 9d0cfbc51e3b6281

  1. Ticket change [28965db927] (rid 136588) by cmcc on 2014-01-27 00:45:04:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      From the following:
      
      oo::class create creator {
          method moop {args} {
      	puts stderr "moop"
          }
          method create {args} {
      	puts stderr "create"
          }
          constructor {args} {
      	puts stderr "constructed"
          }
      }
      
      creator create fred
      fred moop
      
      I get the output:
      
      constructed
      moop
      
      Where I would have expected to see 'create' ... this represents a pretty significant change to the relationship between oo::class and the rest over earlier tcloo versions, and also suggests that "create" has become something of a reserved word within tcloo.
      
      Is there some documentation for this behaviour?
      
      Colin
      
    5. foundin initialized to: "tcl8.6.1"
    6. is_private initialized to: "0"
    7. login: "cmcc"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "16910d69b11045755316a073070779a85cd9218f"
    10. resolution initialized to: "None"
    11. severity initialized to: "Important"
    12. status initialized to: "Open"
    13. submitter initialized to: "cmcc"
    14. subsystem initialized to: "- New Builtin Object Types"
    15. title initialized to:
      method [create] is handled very differently from other methods
      
    16. type initialized to: "Bug"
  2. Ticket change [f1cb51b4c1] (rid 136589) by dkf on 2014-01-27 12:01:47:

    1. closedate changed to: "2456685.00124179"
    2. closer changed to: "dkf"
    3. icomment:
      Everything looks fine to me, and I've not done anything odd here for ages.
      <pre>
      % oo::class create creator {
          method moop {args} {
      	puts stderr "moop"
          }
          method create {args} {
      	puts stderr "create"
          }
          constructor {args} {
      	puts stderr "constructed"
          }
      }
      ::creator
      % creator ?
      unknown method "?": must be create, destroy or new
      % creator create fred
      constructed
      ::fred
      % fred ?
      unknown method "?": must be create, destroy or moop
      </pre>
      However, it should be noted that the <tt>create</tt> that you normally see is the one provided by the <i>class</i> object, not the instance object. It's actually a normal method that is implemented in C and defined on the <tt>oo::class</tt> class.
      <pre>
      % info class methods oo::class
      create new
      % info class methods oo::class -all
      create destroy new
      </pre>
      (The <tt>-all</tt> means use the superclass method implementations as well, so it picks it up from the <tt>oo::object</tt> class.)
      <p>
      Metaclasses are funky stuff.
      
    4. login: "dkf"
    5. mimetype: "text/html"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"
    8. subsystem changed to: "35. TclOO Package"
    9. username: "dkf"