I'm reading the r6rs(Revised6 Report on the Algorithmic Language Scheme), in the "INTRODUCTION" part there is one summary:
"Scheme was the first major dialect of Lisp to distinguish procedures from lambda expressions and symbols, to use a single lexical environment for all variables, and to evaluate the operator position of a procedure call in the same way as an operand position."
My questions are:
what's the benefit of "to distinguish procedures from lambda expressions and symbols"?
what's the single lexical environment? my understanding is, because of the lexical scope, everything in Scheme are "lexical", no run-time scope there, location/position in the source code means more about the environment.
how to understand "to evaluate the operator position of a procedure call in the same way as an operand position"? my understanding is the symbol at operator position is evaluated as operand position. for example:
(define test
(lambda (x)
((if (> x 0) + -) 1 2)))
the "(if (> x 0) + -)" is at the operator position, its evaluation is same as other operand position's evaluation.
Well, Scheme has a single lexical environment, but older lisps can have more than one lexical environment. If for example you maintain separate environments for function (names) and argument (names), then you can write:
When you have one environment for functions and another for arguments, procedure calls use the function argument to lookup the operator, and the other environment for the arguments.
See also this answer (by none other than Kent Pittman) and follow the link to the paper on lisp-1 vs lisp-2.
Is "Lisp-1 vs Lisp-2" relevant in a language with static types?