Overview
| Artifact ID: | 298a69d39d58c90aa589695618d57f242b7c933b |
|---|---|
| Ticket: | 1998221fffffffffffffffffffffffffffffffff
class mixins are in the wrong spot in the callchain |
| User & Date: | mpc_janssen on 2008-06-19 20:27:08 |
Changes
- assignee changed to: "dkf"
- cmimetype changed to: "text/plain"
- comment changed to:
Executing the following script: oo::class create A { method a_with_next {} {puts a_awn ; next} method a {} {puts a_a} } oo::class create AM { method a_with_next {} {puts am_awn ; next } method a {} {puts am_a ; next} method b {} {puts a_b ; next} } oo::define A mixin AM A create a a a a a_with_next a b gives the following output: a_a a_awn am_awn a_b e.g. methods in the class are called before the methods in the mixin class. This has several consequences: 1) If a class should be extensible by a mixin, the method defined in the class should call next to run the functionality in the mixed in method. 2) because you will not know a priori if anyone would extend your class in this way you will have to end every method with a call to next 3) because of 2, next is a silent noop when no next method exists. If the call chain is changed so that mixed in methods are called first: 1) methods will not need a call to next to be extensible by mixins 2) a next with no next method can become an error again (as it should be IMO) Also note that this will then be consistent with mixins on objects, where the mixed in method *is* called before the method on the object. - foundin changed to: "None"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "mpc_janssen"
- subsystem changed to: "35. TclOO Package"
- title changed to:
class mixins are in the wrong spot in the callchain
- type changed to: "Bug"