How to delete variable/forms in Lisp?
问题 In Python we have the del statement for deleting variables. E.g: a = 1 del a What the equivalent of this in Lisp? (setq foo 1) ;; (del foo) ? 回答1: In Common Lisp. For symbols as variables: CL-USER 7 > (setf foo 42) 42 CL-USER 8 > foo 42 CL-USER 9 > (makunbound 'foo) FOO CL-USER 10 > foo Error: The variable FOO is unbound. See: MAKUNBOUND (defined) SLOT-MAKUNBOUND (defined) FMAKUNBOUND (defined) 回答2: Python names reside in namespaces, del removes a name from a namespace. Common Lisp has a