Artifacts Associated With Ticket 9d0cfbc51e3b6281
Ticket change [28965db927] (rid 136588) by cmcc on 2014-01-27 00:45:04:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- 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 - foundin initialized to: "tcl8.6.1"
- is_private initialized to: "0"
- login: "cmcc"
- priority initialized to: "5 Medium"
- private_contact initialized to: "16910d69b11045755316a073070779a85cd9218f"
- resolution initialized to: "None"
- severity initialized to: "Important"
- status initialized to: "Open"
- submitter initialized to: "cmcc"
- subsystem initialized to: "- New Builtin Object Types"
- title initialized to:
method [create] is handled very differently from other methods
- type initialized to: "Bug"
Ticket change [f1cb51b4c1] (rid 136589) by dkf on 2014-01-27 12:01:47:
- closedate changed to: "2456685.00124179"
- closer changed to: "dkf"
- 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. - login: "dkf"
- mimetype: "text/html"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- subsystem changed to: "35. TclOO Package"
- username: "dkf"