Hi XOTcl developers,<br><br>I have been using XOTcl for a while and I have discovered that the default implementation of the Class unknown method is harmful to large scale development. The default implementation calls create from the unknown method. Here is an example that shows the problem:<br>
<br>Class A<br><br>A nstproc doX {} { puts done}<br><br>A intsproc doY {} { puts done }<br><br>The problem here is that misspellings of class methods will cause objects to be created instead of methods to be defined on the class. Here we will have an object named ::nstproc and one named ::intsproc which are both misspellings of instproc.<br>
<br>There is a simple fix for this:<br><br>Class proc unknown { args } {<br><br>error "[ self ] Unknown command: \"$args\""<br><br>}<br><br>Class instproc unknown { args } {<br>
<br>
error "[ self ] Unknown command: \"$args\""<br>
<br>
}<br>
<br>This will require classes and objects to be created explicitly with the create or new method. I find this preferable to having mistakes silently ignored. I have seen this problem in the wild as well as in my code. XOTclIDE had several misspellings that were ignored until I loaded with my fix. Of course existing XOTcl projects will have to be modified to insert create methods where needed. <br>
<br>Ben Thomasson<br>