Artifacts Associated With Ticket 2952145fffffffff
Ticket change [496e56937d] (rid 100050) by apnadkarni on 2010-02-15 15:56:49:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
A posting by Martin Lembourg in c.l.t leads to the following question - how does one implement the following scenario: Two independent classes A and B and a class C that derives from both of them. I want to be able create objects of each of these classes. When I create an object of class C, constructors for both A and B must be called. The issue is that ( assuming the statement "superclass A B" in C's definition), if A's constructor has a command "next", the statement "A create foo" raises an error "no next constructor implementation". If we remove the "next" command from A's constructor, then "A create foo" works but then when doing "C create bar", the constructor for B does not get called (presumably because A's constructor no longer has a next statement). So how does one write code to meet the above requirements ? (tested with CVS HEAD as of Feb 15 2010) /Ashok
- foundin initialized to: "obsolete: 8.6b1.1"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "apnadkarni"
- subsystem initialized to: "35. TclOO Package"
- title initialized to: "Constructor call chain configuration"
- type initialized to: "Bug"
Ticket change [692ad3cf00] (rid 103199) by dkf on 2010-02-15 23:13:29:
- icomment:
I hate these sorts of questions. The (hardline ontological-theoretic) answer is that if A and B are truly wholly independent classes, C has no business deriving from both of them. If they are not that separate, make both A and B derive from a common parent class and the problem goes away. If you wish to argue that I'm wrong, feel free. Demonstrate a specific example where it matters. Not a theoretical example either; while I know it is certainly possible to create code that will fail in the circumstances outlined, my whole point is that code that is going to be working sanely will not actually need to do so. Thus a combobox widget can be considered to be a subclass of entry, but not of listbox. (The listbox-ness is best held in another widget that is delegated to, with forwarded methods doing the delegation.)
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [91f476b781] (rid 120704) by dkf on 2010-02-15 23:13:30:
- closedate changed to: "2010-02-15T16:13:30"
- closer changed to: "dkf"
- resolution changed to: "Invalid"
- status changed to: "Pending"
Ticket change [528ef49898] (rid 126335) by sf-robot on 2010-03-02 09:20:40:
- icomment:
This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker).
- login: "sf-robot"
- mimetype: "text/plain"
- username: "sf-robot"
- icomment:
Ticket change [9281b1e5bc] (rid 120769) by sf-robot on 2010-03-02 09:20:41:
- closedate changed to: "2010-03-02T02:20:41"
- closer changed to: "sf-robot"
- icomment:
allow_comments - 1
- login: "sf-robot"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "sf-robot"
Ticket change [4e084599e3] (rid 127156) by dkf on 2012-05-30 17:32:23:
- icomment:
TIP #381 introduced [nextto], which can be used in constructors to do exactly this sort of thing.
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- username: "dkf"
- icomment: