Artifacts Associated With Ticket 1959486
Ticket change [cd1ab4b0e4] (rid 95825) by dgp on 2008-05-07 12:49:51:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Please address the comments in http://aspn.activestate.com/ASPN/Mail/Message/tcl-core/3316529 Too low on network connect and power to rephrase again here at the moment.
- foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "35. TclOO Package"
- title initialized to: "[oo::define] and self.*"
- type initialized to: "RFE"
Ticket change [9290f47cfa] (rid 120780) by dkf on 2008-05-08 22:20:25:
- icomment:
Logged In: YES user_id=79902 Originator: NO From the link... My reaction re-reading the TIP is that this complexity appears to be the result of forcing everything into a single command, [oo::define]: oo::define $objectOrClass $script The commands in $script do different things depending on whether or not $objectOrClass is a class, and then there are special self.* provisions to force a class value of $objectOrClass to be treated as a plain object value of $objectOrClass. (Since every class is also an object). Seems to my uneducated perspective it would be clearer to have two defining commands: oo::objdef $object $script1 oo::classdef $class $script2 And have the commands in $script1 treat $object as an object and the commands in $script2 treat $class as a class (and oo::classdef error in the case that $class is not a class). It's not like anyone can use the proposed [oo::define] effectively without knowing whether or not the first argument they pass is a class or not. So if they have that knowledge, there's no additional burden in having them choose between [objdef] and [classdef]. I think? I'm guessing there's some deep reason either in the theory or in the implementation why things haven't gone that way, and I don't yet appreciate it, but that's my reaction trying to navigate the [oo::define] spec.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [9626ff36eb] (rid 106276) by dkf on 2008-05-08 22:20:46:
- priority changed to: "9 Immediate"
Ticket change [ee3ff8b5ce] (rid 104050) by dkf on 2008-05-08 22:31:52:
- icomment:
Logged In: YES user_id=79902 Originator: NO My response... That's a really good suggestion actually. I might go for oo::objdefine instead of oo::objdef and leave oo::define for classes, but the overhead's quite low either way. Now, why don't I remember seeing this before? :-(
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [1655329bb9] (rid 124701) by kennykb on 2008-05-09 04:49:45:
- icomment:
Logged In: YES user_id=99768 Originator: NO I like oo::objdef and oo::define. oo::define is the usual thing to do in a class-based (rather than traits-based) system, so it makes sense to have it be the one with the unqualified name. And it gets rid of the self.* stuff. If we can do it quickly, make it so!
- login: "kennykb"
- mimetype: "text/plain"
- username: "kennykb"
- icomment:
Ticket change [1f4b73a2ac] (rid 91126) by dkf on 2008-05-09 06:09:05:
- closedate changed to: "2008-05-08T23:09:05"
- closer changed to: "dkf"
- icomment:
Logged In: YES user_id=79902 Originator: NO Implemented it! Will form part of 0.3. (I'm glad really, the self. prefixes had been bothering me for a while, but when we did the initial design they were the best idea we could come up with. But splitting oo::define really is much better.)
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Accepted"
- status changed to: "Closed"
- username: "dkf"
Ticket change [3b1b531437] (rid 112670) by das on 2008-05-09 07:28:18:
- icomment:
Logged In: YES user_id=90580 Originator: NO one disadvantage of this solution is that you now can no longer use the self. commands in a oo::class create {} block e.g. to define a class method, you have to use a separate oo::objdef now, splitting the class definition among several commands... Worth it to get rid of the self. ugliness IMO, but if possible it might be nice to have a way to somehow integrate the objdef bits of a class definition into the oo::class block, e.g. with a self {} subblock or something of that nature ? - login: "das"
- mimetype: "text/plain"
- username: "das"
- icomment:
Ticket change [0b24967420] (rid 113935) by dkf on 2008-05-11 17:11:27:
- icomment:
Logged In: YES user_id=79902 Originator: NO That's another good suggestion. Implemented.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [50e9f0ac8e] (rid 126055) by dgp on 2008-05-13 02:17:37:
- icomment:
Logged In: YES user_id=80530 Originator: YES Thanks for considering and acting on this. I'm ok with what you've done. FWIW, reading my own message 18 months later, today I think I would suggest an "ensemble" solution: oo::define object $object $script1 oo::define class $class $script2 Make of that what you will.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment: