[Cuis-dev] class variables

Andres Valloud ten at smallinteger.com
Wed Jun 12 08:48:40 PDT 2024


Another way: lazy initialization (so, with accessors for the class 
variable on the class side).  I would also look into whether you need 
class variables (that act like private globals) or class instance 
variables (which are instance variables of the class object, as their 
name suggests).

On 6/12/24 08:28, Juan Vuletich via Cuis-dev wrote:
> On 6/12/2024 12:01 PM, Mark Volkmann via Cuis-dev wrote:
>> In Cuis Smalltalk are class variables required to have names that 
>> begin with an uppercase letter?
> 
> That's usual practice.
> 
>> What is the proper way to initialize class variables? Should I define 
>> an `initialize` method on the class side and initialize all the class 
>> variables there? This does not seem to work for me.
> 
> There's no single 'proper' way. A class side #initialize method is an 
> usual way. See, for example, how Float does it. You need, of course, to 
> actually call that #initialize method so it runs.
> 
>>
>> -- 
>> R. Mark Volkmann
>> Object Computing, Inc.
> 
> HTH,
> 
> -- 
> Juan Vuletich
> cuis.st
> github.com/jvuletich
> researchgate.net/profile/Juan-Vuletich
> independent.academia.edu/JuanVuletich
> patents.justia.com/inventor/juan-manuel-vuletich
> linkedin.com/in/juan-vuletich-75611b3
> twitter.com/JuanVuletich
> 
> 


More information about the Cuis-dev mailing list