Skip to content
Tcl Source Code History Of Ticket 2530725
Login

History Of Ticket 2530725

Artifacts Associated With Ticket 2530725

  1. Ticket change [a1afde428b] (rid 109769) by apnadkarni on 2009-01-23 09:36:23:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      I found the behaviour exhibited in the wish session below surprising. Defining an empty constructor behaves as though no constructor was defined for the class at all. In particular,
      - I would expect the derived class constructor to "hide" the superclass constructor and not execute it since there is no next call. Creating a D object is seen to run the C construtor
      - I would expect info class constructor D to return a pair containing the arg a and an empty body
      - A constructor defined with an empty body behaves the same as a constructor defined with the statement "next" (or similar, there might be differences in presence mixins). That does not seem right
      - Adding a comment to a body changes the code that is executed - see the difference between behaviour of class D and E, the only difference being addition of a comment. This to me is the biggest NO-NO.
      
      (web) 2 % oo::class create C {
      > constructor {a} {set ::x $a}
      > }
      ::C
      (web) 3 % oo::class create D {
      > superclass C
      > constructor {a} {}
      > }
      ::D
      (web) 4 % info class constructor D
      (web) 5 % info class constructor C
      a {set ::x $a}
      (web) 6 % D create d
      wrong # args: should be "D create d a"
      (web) 7 % D create d 1
      ::d
      (web) 8 % set x
      1
      (web) 10 % oo::class create E {
      > superclass C
      > constructor {a} { # Just a comment }
      > }
      ::E
      (web) 11 % set x 0
      0
      (web) 12 % E create e
      wrong # args: should be "E create e a"
      (web) 13 % E create e abc
      ::e
      (web) 14 % set x
      0
      
      /Ashok
      
    4. foundin initialized to: "obsolete: 8.6b1"
    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: "apnadkarni"
    10. subsystem initialized to: "35. TclOO Package"
    11. title initialized to: "Surprising behaviour of empty constructor"
    12. type initialized to: "Bug"
  2. Ticket change [c543924dbb] (rid 111968) by dkf on 2009-01-28 22:30:47:

    1. icomment:
      If the body of a constructor (or destructor) is the empty string, the constructor(/destructor) is deleted. This is documented.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  3. Ticket change [64df5bf4a4] (rid 92846) by dkf on 2009-02-15 16:00:45:

    1. closedate changed to: "2009-02-15T09:00:45"
    2. closer changed to: "dkf"
    3. icomment:
      
      
      allow_comments - 1
      
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"
    8. username: "dkf"