1

I have been watching OCW for the MIT course 6.0001 Introduction to computer science https://www.youtube.com/watch?v=nykOeWgQcHM&list=PLUl4u3cNGP63WbdFxL8giv4yhgdMGaZNA&index=2. In the first lecture, scalar objects are defined as objects which cannot be subdivided, however, while trying to determine if strings were considered scalar objects, I stumbled upon this other definition for what scalar objects are. https://stackoverflow.com/a/37505388/20693633

refers to values that can express scale (hence the name), such as size, volume, counts, etc. Integers, floating point numbers, and fractions are scalars. Complex numbers, Booleans, and strings are NOT scalars. Something that is atomic is not necessarily scalar and something that is scalar is not necessarily atomic. Scalars can be native or provided by libraries. <

this definition is not complimentary but contradictory to the one given by 6.0001 as it does not consider Booleans to be scalar objects something that 6.0001 says they are.

Slide containing some objects which are scalar (minutes 31:06 from video 1 what is computation?

I did not dismiss the commenter's definition because it does make sense to me linguistically. I would like to know which definition is correct and if strings are considered scalar objects.

  • 1
    The SO answer you linked to has some useful comments: for example *"In the context of programming languages, scalar has different meanings, unfortunately." ... "this doesn't seem to be the most commonly accepted one" ... "most people do not use it in this specific sense"* – slothrop Jun 20 '23 at 07:57
  • The top-voted answer on that question is a better guide to how the term is used: https://stackoverflow.com/a/6628566/765091 *"A scalar is a "single" value - integer, boolean, perhaps a string - while a compound is made up of multiple scalars (and possibly references to other compounds)."* – slothrop Jun 20 '23 at 07:58

0 Answers0