|
2007-04-24
| ||
| 20:16 | • Ticket [1706593fff] autoloading causes (itcl) 'class already exists' err... artifact: 4c3e839cef user: legolas_a20 | |
| 20:16 | • Add attachment tclbug.zip to ticket [1706593fff] artifact: 9b079d7335 user: legolas_a20 | |
| 13:16 | • New ticket [1706593fff] autoloading causes (itcl) 'class already exists'... artifact: 522ecb99dc user: legolas_a20 | |
autoloading causes (itcl) 'class already exists' error
Open1706593fffffffffffffffffffffffffffffffffCreated 20 years agoUpdated 20 years ago
Descriptionplain2007-04-24 13:16:16
There is a 'bug' in the itcl implementation of auto_mkindex_parser::command, that causes an error message saying: class "::A" already exists if it is combined with a simple error in the itcl class and autoloading. I realize this is not completely a tcl core problem, however the autoload package already appears to try to 'defend' against errors in external parser commands, and if this case could also be caught, it could return a much better error message. Example in the attachment, in short: itcl allows you to declare a proc but implement it later (C++ style separation of header and implementation). itcl has implemented the parsing for autoload by adding the proc to the autoload list when the declaration is seen (probably because you can also implement the proc inline with the declaration, again matching C++ style.) Now, if you declare but not implement a proc, it is listed in the tclindex file, but after sourcing the file, the command is still not defined. However, the current checks against this all pass. Then, the command is started, causing a recursive call into the autoload code, which sources the file again, which results in the error. (I have tried to reproduce this without itcl, but haven't been able to. I don't fully understand how itcl creates it's class procedures as tcl procs and namespaces, and how this succeeds in bypassing the existing checks.) Note: tested using itcl 3.3, everything was installed by activestate's 8.4.14 tcl installer, on windows xp sp2.
legolas_a20plain2007-04-24 20:16:18
File Added - 226391: tclbug.zip
Log in (anonymous is fine) to add a comment.
Attachments:
- tclbug.zip [download] added by legolas_a20 on 2007-04-24 20:16:17. [details]