Messages from list : cormas@cirad.fr

Choose a topic among the following archives :

RE : variables

New Message Reply Date view Thread view Subject view Author view

Subject: RE : variables
From: Christophe Le Page (christophe.le_page@cirad.fr)
Date: Thu Apr 01 2004 - 12:37:38 CEST

Hello Bernardo,

For this kind of syntaxic precisions, you may look at the Application
Developper's Guide (a pdf file in the doc subdirectory of the VW7
distribution).

Instance Variables (p. 79)
Instance variables hold data that is specific to an individual instance
of a class. The variable’s value describes a state or attribute of the
instance. An instance variable is created when the instance is
generated, and exists as long as the instance does. The name scope is
the instance
itself, which is the only object that can reference the variable itself.

Class Instance Variables (p. 90)
A class instance variable stores data that varies with each subclass in
a hierarchy. It is declared as part of the class definition, and can
only be accessed by a class method.

The advantages of class instance variables are that you still only have
to initialize them once for each subclass (unlike instance variables)
and all subclasses can reuse methods that employ a common variable name.

A bientôt !
Clp

> -----Message d'origine-----
> De : owner-cormas@cirad.fr [mailto:owner-cormas@cirad.fr] De
> la part de Bernardo Paz Betancourt
> Envoyé : mercredi 31 mars 2004 22:23
> À : cormas@cirad.fr
> Objet : variables
>
>
> Hello,
>
> Using cormas, the moment to declare the variables names they
> are 2 choices:
> " class instance variables" and " intance variables"
> I was using the first one to define the super class variables
> and the other to define the variables for the objects to be
> instancied.
>
> But now reading the Introduction to smalltalk from Ivan Tomek
> (2000) I see that the task is more subtle than this. Does any
> one have a practice rule?
>
> Thankyou in advance. Bernardo
>
>
>
>
>

New Message Reply Date view Thread view Subject view Author view
 

Back to home