Procedures Functions as Black-Box Abstractions - SICP Comparison Edition" /> 1.1.8   <span style="color:green"> Procedures </span> <span style="color:blue"> Functions </span> as Black-Box Abstractions - SICP Comparison Edition
Original JavaScript
Figure 1.3 Procedural decomposition of the sqrt program.
Figure 1.4 Functional decomposition of the sqrt program.

[1] It is not even clear which of these procedures functions is a more efficient implementation. This depends upon the hardware available. There are machines for which the obvious implementation is the less efficient one. Consider a machine that has extensive tables of logarithms and antilogarithms stored in a very efficient manner.
[2] The concept of consistent renaming is actually subtle and difficult to define formally. Famous logicians have made embarrassing errors here.
[3] Lexical scoping dictates that free variables in a procedure names in a function are taken to refer to bindings made by enclosing procedure definitions; function declarations; that is, they are looked up in the environment in which the procedure was defined. function was declared. We will see how this works in detail in chapter 3 when we study environments and the detailed behavior of the interpreter.
[4] Embedded definitions must come first in a procedure declarations must come first in a function body. The management is not responsible for the consequences of running programs that intertwine definition declaration and use; see also footnotes 2 and 4 in section 1.3.2.
1.1.8   Procedures Functions as Black-Box Abstractions