Re:Playing with Syntax
by Avshalom on Saturday August 20, 2016 @02:41PM
(#12327810)
on the other hand = is one character, and if it's not a legal character in identifiers then
x=1 y=2 z=3 takes 2n characters (setf x 1 y 2 z 3) takes 2n+7 characters (plus however many we're using for the actual identifies and values but those'll be the same between examples)
[ Parent
| on HN ]
Lisp has an = function; so that binding is taken. Symbols in the keyword package are allowed to have function bindings, and so a synonym for setf can be called := (the symbol named "=" in the keyword package).
[1]> (defmacro := (&rest args) `(setf ,@args))
:=
[2]> (defvar a)
A
[3]> (:= a 42)
42
[4]> a
42
[5]> (= a 42)
T