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

[ad_1] 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 … Read more

[Solved] Lisp – string concat

[ad_1] CL-USER 1 > (format nil “This is too easy. ~a day I’ll learn Lisp.” 1) “This is too easy. 1 day I’ll learn Lisp.” [ad_2] solved Lisp – string concat

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

[ad_1] (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.) [ad_2] solved Lisp: … Read more