[Xotcl] Classifier scoped data in XOTcl?

Uwe Zdun uwe.zdun at wu-wien.ac.at
Fri Nov 14 10:48:36 CET 2003


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@{xotcl,computer,acm}.org, uwe.zdun at wu-wien.ac.at





More information about the Xotcl mailing list