Re:Lisp, Smalltalk, and the power of symmetry (2014)
by renox on Monday May 30, 2022 @04:26AM
(#31556718)
Positionality is good only when arguments are interchangeable/commutative like addition or when the types are different which ensure that any mistakes in the order will be detected by the compiler.
In all the other case positionality is bad: see memset for example.
A Lisp can use an alist to represent a set of key-value pairs, and is easy enough to shadow values there:
This makes it easy to implement things like inheritance or trees of lexical environments.I sometimes wish that Lisp had better ergonomics for hash tables, but normally I am pretty happy that folks don't reach for them first. Frankly, I think positionality is normally good. Can you image how terrible it would be to program a language in which addition is represented as: