Hello Gustaf,
Thanks for your reply!
The recommended way to check, if an object is of a certain
type (is a direct/indirect instance of a certain class) is to use "istype".
I replaced all of my calls to "Object info class ?pattern?" to "Object istype ?pattern?" and it works well. Out of curiosity, is the "istype" method new to 1.6.0?
The old interface matches only with the
superclass elements, when pattern is specified. There are essentially two options to proceed:
(a) "info class ?pattern?" could be fixed to match with the current class and the superclasses, but then it should return always empty, when the pattern does not match, as it is now in accordance to other cases, where ?pattern? is used.
(b) It is as well possible to remove the ?pattern? argument from "info class", since there is as well istype. Note that there is as well "info precedence ?pattern?", which returns the resolution order including mixins and superclasses.
approach (a) makes it easy to query the classes either with or without mixins, but to get the full list, one should use "[f info class] info superclass -closure", or we implement as well a "info class -closure".
Or in the case (b) "info precedence" could get an option to list only intrinsic classes (classes which are no mixins). One can use a single method to get a full or partial list, and one can use ?pattern? to filter the list in a uniform way.
Opinions?
To me, option (b) seems clearer. Type checking is simplified to the use of "istype", while "info" is focused on more advanced introspection. However, I'm new to XOTcl, so I may not be thinking ahead to interaction with the advanced features. I'm sure you guys will make the best decision!
The only thing I'll ask for here is the updated documentation on the website. I also think that there should be documentation for each major version of XOTcl on the website, so that it's clearer as what the differences are between versions. Just my two cents.
Thanks again!
Cheers, Edmond