Difference between SET, SETQ and SETF in LISP

SET can set the value of symbols;
 
SETQ can set the value of variables;
 
SETF is a macro that will call different function depending on what was called as its first argument.
 
examples
 
(set (quote l) '(1 2 3))
(1 2 3)
 
 
(set l '(1 2 3))
Failure, l must be a symbol.
 
 
(set 'l '(1 2 3))
(1 2 3)
 
 
(setq l '(1 2 3))
(1 2 3)
 
 
(setq (car l) 10)
Failure.
 
 
(setf l '(1 2 3))
(1 2 3)
 
 
(setf (car l) 10)
l is (10 2 3)
原文地址:https://www.cnblogs.com/johnpher/p/3404575.html