[Xotcl] IDE and objects

mail at xdobry.de mail at xdobry.de
Mon Jan 10 13:21:14 CET 2011


 
 


> I found XOTclIDE, but it looks a little bit exotic... 
XOTcl is exotic too ;)
 

>
> Second question: lets assume that I want to check if particular variable
> contains a TCL object of given class: $var istype MyClass. It works
> good, assuming that $var contains an object, but if there is a value
> like "15" we get an error.
> Is there a nice way to check if a variable contains an object of given
> class and at the same time just get a false answer in case it does not
> contains a XOTCL object? 
Object isobject $var && $var istype MyClass
 
Perhaps "hasclass" is better for you.
Consult documentation for a difference.
After I have started to use mixins so time ago, I have to adapt all istype to
hasclass.
 
proc isObjectOfType {obj type} {     expr {[Object isobject $obj] && [$obj
istype $type]}
}
 
Could be defined as Object proc
 
 
Artur


More information about the Xotcl mailing list