Closed TobiasWrigstad closed 4 years ago
There is no relationship.
is_variable is used in chapter 2 when dealing with symbolic computation. Here "variable" means what it means in math: a symbol that stands for many possible values. It's introduced here: https://source-academy.github.io/chapters/2.3.2.html#p7 These variables are used in representations of mathematical formulas, for example for symbolic differentiation.
is_name is used in chapter 4 when dealing with the syntax of Source. Our parser represents square; as a tagged list: ["name", ["square", null]] The function is_name checks the tag, see https://source-academy.github.io/chapters/4.1.2.html#p2
Regarding Source, the terminology that I would like to establish (and will read everything closely to make sure we achieve it) is:
So the string "square" above is a "symbol" as far as chapter 4 is concerned. Thus the function "symbol_of_name" in https://source-academy.github.io/chapters/4.1.2.html#p2
Previously I had "name_of_name" instead of "symbol_of_name", which is super-weird. The distinction between symbols and names comes very handy and improves clarity in chapter 4, I think.
Which one to use and where?