Procedures Functions - SICP Comparison Edition" /> 1.1.4   Compound <span style="color:green">Procedures</span> <span style="color:blue">Functions</span> - SICP Comparison Edition

[1] Observe that there are two different operations being combined here: we are creating the procedure, function, and we are giving it the name square. It is possible, indeed important, to be able to separate these two notions—to create procedures functions without naming them, and to give names to procedures functions that have already been created. We will see how to do this in section 1.3.2.
[2] Throughout this book, we will describe the general syntax of expressions by using italic symbols delimited by angle brackets—e.g., $\langle \textit{name}\rangle$—to $name$—to denote the slots in the expression to be filled in when such an expression is actually used.
[3] More generally, the body of the procedure can be a sequence of expressions. In this case, the interpreter evaluates each expression in the sequence in turn and returns the value of the final expression as the value of the procedure application.
[4] More generally, the body of the function can be a sequence of statements. In this case, the interpreter evaluates each statement in the sequence in turn until a return statement determines the value of the function application.
[5] The way multi-part names such as sum_of_squares are written affects the readability of programs, and programming communities differ on this. According to the common JavaScript convention, called camel case, the name would be sumOfSquares. The convention used in this book is called snake case, and was chosen for its closer resemblance to the convention used in the Scheme version of this book, where hyphens play the role of our underscores.
[6] Our JavaScript environment includes all functions and constants of ECMAScript's Math object, under the names math_$\ldots$. For example, ECMAScript's Math.log is available as math_log. The MIT Press web page for this book includes the JavaScript package sicp that provides these and all other JavaScript functions that are considered primitive in the book.
1.1.4   Compound Procedures Functions