View · Search · Index
No registered users in community xowiki
in last 10 minutes

Re: [Xotcl] IDE and objects

From: <mail_at_xdobry.de>
Date: Mon, 10 Jan 2011 13:21:14 +0100 (CET)

 
 


> 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