Hello, maybe this is a dumb question, BUT one thing that has always confused me, in trying to learn data structures, is the definition of the term "scalar". I never learned this term in any computer programming before. Anyway, here is how wikipedia defines it:
"In computing, a scalar is a variable or field that can hold only one value at a time; as opposed to composite variables like array, list, record, etc.. In some contexts, a scalar value may be understood to be numeric. A scalar data type is the type of a scalar variable. For example, char, int, float, and double are the most common scalar data types in the C programming language."
Ok, so far so good. Except, as far as I can tell, a "scalar" in PD is a composite variable, right? If I make [struct structure_01 float x float y float k] there are three variables there, not one. Am I missing something?
As far as I can tell, a scalar is to a PD structure, as an instance is to a class definition in OOP. Is that right or way off?
Appreciate your comments on this. Thanks!
~David
On Wed, 23 Aug 2006, David Powers wrote:
Ok, so far so good. Except, as far as I can tell, a "scalar" in PD is a composite variable, right?
One man's scalar is another man's collection...
You'll find the definition of scalar to be vaguely the same everywhere, but people won't agree on what's composite and what's not.
In PureData's DS, a "scalar" is a struct which is not in an array.
As far as I can tell, a scalar is to a PD structure, as an instance is to a class definition in OOP. Is that right or way off?
It's half right. Every array element is also an instance of a struct.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada