Context Dependent Syntax, Lisp setf, Python a[i]=x
Common Lisp setf is Worst Computer Language Design
the Common Lisp setf is the most fk'd design in computer languages possible.
a[i]=x, are also fk'd. It's the confounding of meaning. It is exception, irregularity.
here's elisp manual explaining setf.
Let's talk about a[i] = x, and see what's wrong.
the gist here, is that it uses the same notation to indicate a “place”. For example,
a is the 3rd element in array.
a=4 means make the 3rd place to have value of 4.
The problem here, is that there's different meaning of
a in the 2 cases.
evaluates to a value.
does not evaluate. Rather, it's part of the syntax that tells the compiler of a “storage location”.
So, you see, the
print a and
a=4 have diff meaning, and is context dependent.
And of course Forth also explicitly has fetch and store ops so you can say
3 a @ .and
x @ 3 a !for printing and assignment
The Bliss language (DEC Systems lang) had a unary dot operator to return a value so you'd say
—from Bahstin Beer Bum @mmaug, 2016-10-05
Ask me question on patreon