Skip to content
Tcl Source Code History Of Ticket 2006660fffffffff
Login

History Of Ticket 2006660fffffffff

Artifacts Associated With Ticket 2006660fffffffff

  1. Ticket change [0cfc743bc0] (rid 114281) by wiede on 2008-06-30 11:17:31:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      itcl has a special feature called constructor init code which is like a body of a proc/script and which is called  directly before the constructor is called with the same callFrame and arguments as the constructor. That is used for example to call constructors explicitly before the normal construction mechanism is doing the calls.
      
      to allow itcl to handle that, here the proposed change to TclOO:
      
      add a ::oo::define constructorinit command on the scripting level.
      
      Add a Tcl_SetConstructorInit command at the C-API and add a constructorInitPtr to the class structure (+ additional stuff in the Foundation, the same as for constructor).
      
      Add additional code in TclOOCall.c on places where CONSTRUCTOR is handled to add a call to the constructorInit code (if it exists) just before the call to the constructor code.
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "wiede"
    10. subsystem initialized to: "35. TclOO Package"
    11. title initialized to: "constructorinit "
    12. type initialized to: "RFE"
  2. Ticket change [425beb1459] (rid 116357) by dkf on 2009-05-11 21:00:38:

    1. priority changed to: "6"
  3. Ticket change [b0fe311b29] (rid 226532) by dkf on 2024-05-23 14:09:02:

    1. closer changed to: "nobody"
    2. comment changed to:
      itcl has a special feature called constructor init code which is like a body of a proc/script and which is called  directly before the constructor is called with the same callFrame and arguments as the constructor. That is used for example to call constructors explicitly before the normal construction mechanism is doing the calls.
      
      to allow itcl to handle that, here the proposed change to TclOO:
      
      add a ::oo::define constructorinit command on the scripting level.
      
      Add a Tcl_SetConstructorInit command at the C-API and add a constructorInitPtr to the class structure (+ additional stuff in the Foundation, the same as for constructor).
      
      Add additional code in TclOOCall.c on places where CONSTRUCTOR is handled to add a call to the constructorInit code (if it exists) just before the call to the constructor code.
      
    3. icomment:
      Does the object instance exist at that point or not?
      
      If this is prior to the object existing, it's best done by enhancing the `create` and `new` methods in an `oo::class` subclass.
      
      If the instance exists, then it's the job of the constructor to set things up. I guess in that case we'd be looking at a "filter for constructors"? I'm not sure how that would work. (For balance, a "filter for destructors" would also be possible, though that would need to be careful as they're called at tricky times such as when the containing namespace is deleted or the interpreter is killed.) This is all just guessing, of course.
      
      I don't want to add a lot of mandatory overhead into the instance creation path (or the general cached method call path either).
      
    4. login: "dkf"
    5. mimetype: "text/x-markdown"
    6. severity changed to: "Minor"
    7. title changed to: "constructorinit"