Python syntax in Lisp and Scheme
Shriram Krishnamurthi
sk at cs.brown.edu
Sun Oct 5 08:50:02 EDT 2003
"Terry Reedy" <tjreedy at udel.edu> writes:
> Lisp (and possibly other languages I am not familiar with) adds the
> alternative of *not* evaluating arguments but instead passing them as
> unevaluated expressions. In other words, arguments may be
> *implicitly* quoted. Since, unlike as in Python, there is no
> alternate syntax to flag the alternate argument protocol, one must, as
> far as I know, memorize/learn the behavior for each function. The
> syntactic unification masks but does not lessen the semantic
> divergence. For me, it made learning Lisp (as far as I have gotten)
> more complicated, not less, especially before I 'got' what going on.
I'm sorry -- you appear to be hopelessly confused on this point. I
can't comment on the dark corners of Common Lisp, but I do know all of
those corners of Scheme. Scheme is a true call-by-value language.
There are no functions in Scheme whose arguments are not evaluated.
Indeed, neithen a function definition, nor an argument location, has
the freedom to "not evaluate" an argument. We can reason about this
quite easily: the language provides no such syntactic annotation, and
the evaluator (as you might imagine) does not randomly make such a
choice. Therefore, it can't happen.
It is possible that you had a horribly confused, and therefore
confusing, Scheme instructor or text.
> Question: Python has the simplicity of one unified assignment
> statement for the binding of names, attributes, slot and slices, and
> multiples thereof. Some Lisps have the complexity of different
> functions for different types of targets: set, setq, putprop, etc.
Again, you're confused. SET, SETQ, etc are not primarily binding
operators but rather mutation operators. The mutation of identifiers
and the mutation of values are fundamentally different concepts.
Shriram
More information about the Python-list
mailing list