On Thu, 2003-04-03 at 08:43, Art Eschenlauer wrote:
> Other OO languages have class variables, i.e., a single variable that is 
> accessible to all instances of a class. I don't see this in Unicon (so I 
> have resorted to using a global variable (or package-scoped global or 
> singleton class...) as a substitute. Are there class variables in Unicon?

Not that I know - would be nice, though.

Here's a 'trick' that gives you most of the functionality of a class
variable, however:

   method var(newValue)
       static value
       value := \newValue
       return value
   end

Assignment:

     var(3)

reference

     x := var()

What's missing is the ability to null it out once it's set.  (There's
a 2nd trick that can be used for that, though...)

-- 
Steve Wampler <[EMAIL PROTECTED]>
National Solar Observatory


-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
_______________________________________________
Unicon-group mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to