Tcl Source Code

View Ticket
12:57 Closed ticket [ad6696285c]: TclOO filters called for unknown and destructors plus 5 other changes artifact: 1e841d6910 user: dkf
12:57 Ticket [ad6696285c]: 4 changes artifact: 553d525e75 user: dkf
[ad6696285c] Correction of description of filter behaviour with 'unknown'. check-in: 90adc15aa1 user: dkf tags: trunk
[ad6696285c] Demonstrate that filters are not called for destructors. check-in: 413d3622d5 user: dkf tags: trunk
12:04 Ticket [ad6696285c] TclOO filters called for unknown and destructors status still Open with 4 other changes artifact: 1d65410151 user: dkf
11:13 Ticket [ad6696285c]: 3 changes artifact: cf0828a5d8 user: dkf
11:12 Ticket [ad6696285c]: 3 changes artifact: 9fcc53cdd5 user: dkf
12:32 Ticket [ad6696285c]: 3 changes artifact: b427ffda7c user: dkf
16:28 Ticket [ad6696285c]: 4 changes artifact: e141d9bf17 user: dkf
14:16 Ticket [ad6696285c]: 3 changes artifact: f68a113943 user: apnadkarni
03:30 Ticket [ad6696285c]: 3 changes artifact: d16a162591 user: apnadkarni
03:25 New ticket [ad6696285c]. artifact: e8fb214910 user: apnadkarni

Ticket UUID: ad6696285cacae8f785f394af0f637c2806b66ee
Title: TclOO filters called for unknown and destructors
Type: Bug Version: 8.6.1
Submitter: apnadkarni Created on: 2014-07-22 03:25:36
Subsystem: 35. TclOO Package Assigned To: dkf
Priority: 6 Severity: Minor
Status: Closed Last Modified: 2015-05-17 12:57:26
Resolution: Fixed Closed By: dkf
    Closed on: 2015-05-17 12:57:26
I'm not sure whether this is a documentation bug, an implementation one. The documentation states "Filters are not invoked when processing an invocation of the unknown method because of a failure to locate a method implementation, or when invoking either constructors or destructors."

However, the sample below shows filters are called for unknown and for destructors (though apparently not for constructors).

(tcl) 76 % oo::class create C {
method m {} {puts m}
method f {args} {puts f; next {*}$args}
filter f
method unknown {meth args} {puts unknown}
(tcl) 77 % C create o
(tcl) 78 % o m
(tcl) 79 % o n
(tcl) 80 % 
(tcl) 80 % o destroy

By the way, [info object call o n] also reflects this.
User Comments: dkf added on 2015-05-17 12:57:12:

Corrected the documentation to say that filters are called for unknown method processing. Simpler than changing the current implementation.

dkf added on 2015-05-17 12:04:39:

And now I've looked again, the filter is not being called for the destructor. It's being called for the destroy method, which is a conventional method (that happens to kill the current object).

dkf added on 2014-09-14 11:12:40:

Filters definitely shouldn't be called in the destructor chain. That would be an outright bug.

If they're called in the unknown chain, I might leave that in and alter the docs.

dkf added on 2014-08-17 16:28:43:

Side note: info object call uses the identical datastructure to the actual call mechanism; it generates a call chain and introspects it instead of generating it and calling along it. (self call looks at the current call chain.) It should be enough to just look at the chain without calling it; it still exercises the same builder code.