You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Observe that the list to support two kinds of set operations in the implementation of REPL. The book currently does not tell you how to solve the mystery of sets, in the REPL.
With the REPL, if you do a set within one function, this set is saved for the next iteration; if this was not the case, then the set function would be meaningless. A correct implementation of REPL requires that if you do a set deep inside a function; this set will remain in effect when the function returns. We cannot distinguish between a direct call
> (set ‘a 2)
and indirect call,
> (cond (
((set ‘a 2) t)
)
If we make the distinction, then the user will be confused. So, in the REPL, there are two kinds of SET. Global and local. Also, if the set operation is invoked indirectly, by a function that is defined in the library, then the SET must also prevail. We must have two kinds of SET in the REPL:
Global for setting variable, and local for making bindings.
The subtle issue of the difference between argument binding and global bindings. All SET operations in the book are local. The little lie is that function SET is used in the book to define functions such as QUOTE, NDEFUN, and LAMBDA. But, the book does not deal with issue of evaluating two expressions in sequence, preserving the SETs made in the first expression to the evaluation in the second expressions. As far as the book is concerned, there is no way to do so, since the implementation of the a-list in the book does not support a distinction
between local setting for binding, and global setting of variables.
This is not a serious issue, and the book is fine in describing the implementation of EVAL, but no the implementation of REPL.
But it should be made clear.
The text was updated successfully, but these errors were encountered:
Observe that the list to support two kinds of set operations in the implementation of REPL. The book currently does not tell you how to solve the mystery of sets, in the REPL.
With the REPL, if you do a set within one function, this set is saved for the next iteration; if this was not the case, then the set function would be meaningless. A correct implementation of REPL requires that if you do a set deep inside a function; this set will remain in effect when the function returns. We cannot distinguish between a direct call
and indirect call,
If we make the distinction, then the user will be confused. So, in the REPL, there are two kinds of SET. Global and local. Also, if the set operation is invoked indirectly, by a function that is defined in the library, then the SET must also prevail. We must have two kinds of SET in the REPL:
Global for setting variable, and local for making bindings.
The subtle issue of the difference between argument binding and global bindings. All SET operations in the book are local. The little lie is that function SET is used in the book to define functions such as QUOTE, NDEFUN, and LAMBDA. But, the book does not deal with issue of evaluating two expressions in sequence, preserving the SETs made in the first expression to the evaluation in the second expressions. As far as the book is concerned, there is no way to do so, since the implementation of the a-list in the book does not support a distinction
between local setting for binding, and global setting of variables.
This is not a serious issue, and the book is fine in describing the implementation of EVAL, but no the implementation of REPL.
But it should be made clear.
The text was updated successfully, but these errors were encountered: