[Solved] creating assoc function in lisp that will find value from a-list

The most basic lisp operations are list eaters: (defun some-function (list-to-consume perhaps-additional-args) (cond ((endp list-to-consume) <end-of-list-expression>) ((<predicate> list-to-consume perhaps-additional-args) <result-expression>) (t (some-function (cdr list-to-consume) perhaps-additional-args)))) Examples: ;; The predicate is the endp expression (defun mylength (list &optional (len 0)) (cond ((endp list) len) (t (mylength (cdr list) (1+ len))))) ;; A member function (defun mymember … Read more

[Solved] Lisp: Find the setf way of doing the equivalent of fset [closed]

(symbol-function ‘foo) is a Generalized Variable in elisp, so you can use: (setf (symbol-function ‘forward-word) #’backward-word) as an alternative to: (fset ‘forward-word #’backward-word) (As a side-note, you can do the same thing with cl-letf as a replacement for the deprecated flet when you want to override a function using dynamic scope.) solved Lisp: Find the … Read more