No registered users in community xowiki
in last 10 minutes
in last 10 minutes
Re: [Xotcl] Classifier scoped data in XOTcl?
From: Uwe Zdun <uwe.zdun_at_wu-wien.ac.at>
Date: Fri, 14 Nov 2003 10:48:36 +0100
In XOTcl each class is an object: so a variable of a class can be used as a
classifier-scoped attribute of all instances of that class.
Example:
Class Point
Point set classVar 1
Point instproc getClassVarFromInstance {} {
[self class] set classVar
}
Point p1
Point p2
puts [p1 getClassVarFromInstance]
-> 1
puts [p2 getClassVarFromInstance]
-> 1
Regards,
Uwe
On Thursday 13 November 2003 22:15, Jim Russell wrote:
> I may have overlooked it in the documentation, but I'm having trouble
> getting a classifier-scoped member variable in XOTcl. Is there a way to
> mimic the behavior of a C++ static data member?
>
> _______________________________________________
> Xotcl mailing list - Xotcl_at_alice.wu-wien.ac.at
> http://alice.wu-wien.ac.at/mailman/listinfo/xotcl
Date: Fri, 14 Nov 2003 10:48:36 +0100
In XOTcl each class is an object: so a variable of a class can be used as a
classifier-scoped attribute of all instances of that class.
Example:
Class Point
Point set classVar 1
Point instproc getClassVarFromInstance {} {
[self class] set classVar
}
Point p1
Point p2
puts [p1 getClassVarFromInstance]
-> 1
puts [p2 getClassVarFromInstance]
-> 1
Regards,
Uwe
On Thursday 13 November 2003 22:15, Jim Russell wrote:
> I may have overlooked it in the documentation, but I'm having trouble
> getting a classifier-scoped member variable in XOTcl. Is there a way to
> mimic the behavior of a C++ static data member?
>
> _______________________________________________
> Xotcl mailing list - Xotcl_at_alice.wu-wien.ac.at
> http://alice.wu-wien.ac.at/mailman/listinfo/xotcl
-- Uwe Zdun Department of Information Systems, Vienna University of Economics Phone: +43 1 313 36 4796, Fax: +43 1 313 36 746 zdun_at_{xotcl,computer,acm}.org, uwe.zdun_at_wu-wien.ac.at