Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 9290f47cfad6ebe4bf16b568fd011fb933afafd1
Ticket: 1959486fffffffffffffffffffffffffffffffff
[oo::define] and self.*
User & Date: dkf on 2008-05-08 22:20:25
Changes

  1. 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.
    
    
    
    
  2. login: "dkf"
  3. mimetype: "text/plain"
  4. username: "dkf"