SICP Terminology: Computational Object

What is the exact definition of a computational object in SICP? Is it value? This expression? This is not entirely clear to me, could you please tell me what is the correct meaning and explain why?

Could you provide examples in your explanation?

I tried to understand the terminology used in SICP by drawing a concept map (see below), but I am stuck on the meaning of the computational object because I cannot decide if the term refers to a value or an expression

enter image description here

enter image description here

EDIT:

Updated map concept after reading answers:

enter image description here

+3


source to share


2 answers


I think the key is in the text you underlined:

A critical aspect of a programming language is the means it provides for using names to refer to computational objects. We say that name identifies a variable whose value is an object.

And a "computational object" is anything that can be the value of a variable. Calling this "computational object", since it is the opposite of just an "object", is probably just adding a little confusion here, since it is probably clear from the context that non-computational objects (such as a sheet of paper) cannot be the value of a variable in a program. However, there are some things related to programs that are not computational objects.

For example, in Scheme, a variable is not a computational object; you cannot store a variable in another variable. In some languages, variables or pointers are at least computational objects and can be the value of a variable.



In the definitions in the text, we see the source code (i.e. expressions). Evaluating expressions yields computational values ​​that can be stored in variables. For example, an expression (+ 2 3)

can be evaluated to produce an integer that is printed as 2

. It is interesting to note, however, that in Lisp languages ​​(and more generally in homoiconic languages) this source code can also be represented as a value. For example, evaluating an expression (list '+ 2 3)

creates a list of characters with a name "+"

, an integer value of two and an integer value of three. The list is printed as (+ 2 3)

.

So we have an idea where objects are used, but what objects actually exist? It depends on the definition of the language. Several types of objects are specified in the schema definition:

  • numbers (and there are different types of numbers)
  • Symbols
  • strings
  • cons cells (these are essentially pairs, and we build lists and trees from them using conditionals)
  • empty list
  • boolean values ​​true and false
  • procedures (often called functions)
  • vectors and arrays
  • & hellip;

Other languages ​​will provide other types, and schema can provide more than what I've listed here. The point is that some objects exist, the developers of the language decide something, and the goal is to give enough primitive types so that the programmer can define what they need in terms of them.

+3


source


I think the term "computational" is only there to distinguish these objects from physical objects. In your concept, the card may be "the same as the value". Note that almost anything can be object and managed in the Schema, including expressions (in macros / metaprogramming).



+2


source







All Articles