# example, of the logical incongruity of the list element assignment syntax, in most imperative (procedural) languages
xList = [3,4,5]
xList[0] = "something"
What is Place Expression, Generalized Variable, in Lisp
lisp should not have the 'place expression' semantics. basically that's the point.
the 'place expr' semantics, is somewhat ok in C like syntax, is because, it's widely adopted convention for some 40 years or so in every lang.
the way it works, is not to think of 'place expression'. rather, when u see the assignment operator =, u have left hand side and right hand side. eg lhs = rhs.
and lhs is treated in a special way. that is, it is not evaluated.
so, we have, x = 4.
now, in the case of
list[0] = 4
that's a more special case.
namely, not only the lhs is not evaluated, but, the lhs expression is treated in a special way, to indicate a position in list.
arguably, this is not a good design.
but can be accepted in new lang, because, it's a widely adopted and well understood convention.
the key thing to note here, is the equal sign for assignment, of the syntax.
now, if u import to lisp syntax, u'll immediately notice oddity.
eg
(setf (nth 0 (list 3 4 5)) "something" )
this breaks lisp semantics.
because again, that nth expression, is not evaluated, not just that, but actually means a special thing.
# example, of the logical incongruity of the list element assignment syntax, in most imperative (procedural) languages
xList = [3,4,5]
xList[0] = "something"