Skip to content
Tcl Source Code View Ticket
Login

View Ticket

modified next command handling

Closed / Accepted2006641fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 13 years ago
Descriptionplain2008-06-30 10:58:27
In the current implementation of TclOO a class with 2 superclasses has an unexpected handling of the next command. if in the constructor there are 2 calls to next then always the constructor of the first superclass is called.

I think a "natural" way would be to always call any entry in a call chain only once.

proposed change:
add a hasBeenCalled flag to the CallChain struct and modify TclOOInvokeContext, to set the hasBeenCalled flag after a call to a method in the call chain. When doing the next call to a method in the call chain, check for entries, which have hasBeenCalled set and skip them until the first entry, which has not set hasBeenCalled. At the end (if (isFirst) { ... }) reset hasBeenCalled for all entries in the call chain.

That would also help itcl to be able to use the "normal" constructor call chain. At the moment itcl is using constructor methods and has additional code to build the correct (for itcl) constructor call chain.
wiedeplain2008-10-06 00:07:30
File Added - 296164: tcloo_bad_next.tcl

How the proposed change is done is not important, it's only described here to describe the logic I would like to have. In the attached file find an example which also makes problems using TclOO
File Added: tcloo_bad_next.tcl
wiedeplain2008-10-06 00:07:52
File Added - 296165: tcloo_bad_next.tcl

How the proposed change is done is not important, it's only described here to describe the logic I would like to have. In the attached file find an example which also makes problems using TclOO
File Added: tcloo_bad_next.tcl
wiedeplain2008-10-06 00:08:51
File Added - 296166: tcloo_bad_next.tcl

How the proposed change is done is not important, it's only described here to describe the logic I would like to have. In the attached file find an example which also makes problems using TclOO
File Added: tcloo_bad_next.tcl
wiedeplain2008-10-06 00:09:38
File Added - 296167: tcloo_bad_next.tcl

How the proposed change is done is not important, it's only described here to describe the logic I would like to have. In the attached file find an example which also makes problems using TclOO
File Added: tcloo_bad_next.tcl
wiedeplain2008-10-06 00:10:41
File Deleted - 296167:
wiedeplain2008-10-06 00:12:09
sorry for posting 4 times, had problems with my browser
dkf Ticket [2006641fff]: 1 change [History diff]2009-05-11 21:00:38
dkfplain2012-05-17 17:53:23
IP - Comment Removed: 94.168.233.125
dkfplain2012-05-17 17:53:25
IP - Comment Removed: 94.168.233.125
dkfplain2012-05-17 17:53:28
IP - Comment Removed: 94.168.233.125
dkfplain2012-05-17 17:53:32
IP - Comment Removed: 94.168.233.125
dkfplain2012-05-17 17:55:16
Does the [nextto] command provide an alternate mechanism for dealing with this?
dkfhtml2013-08-20 10:54:17

Evidence suggests that the nextto mechanism handles this adequately.

Log in (anonymous is fine) to add a comment.

Attachments: