[Tutor] What is a "state variable"?

Richard D. Moores rdmoores at gmail.com
Sat Nov 13 07:14:43 CET 2010


On Fri, Nov 12, 2010 at 17:07, Alan Gauld <alan.gauld at btinternet.com> wrote:
>
> "Richard D. Moores" <rdmoores at gmail.com> wrote
>
>>> For example if I say that the state of any object can be represented
>>> by a vector whose values correspond to the collected set of variables
>>> of the object, does that make sense?

I think I would have understood this if you have used "array of
values" instead of "vector".
>>
>> No. Not the vector idea. Sorry.
>
> A vector is just a fancy mathematical name for an array of values.
> In the case of state the values are those of the set of relevant
> variables that control the behaviour of the program.
>
> In the case of an object it is usually the set of attributes of the
> object plus any local/environment variables. (An object can be
> thought of as a container in the same way as a list or dictionary)
>
> So the state variables of a class are those that affect the
> functioning of the class.
>
> As an example

Your increasingly complex but clear example was very useful to me. Thank you.

Dick


More information about the Tutor mailing list