How to call this function in Common Lisp?

(defun (setf xwin-border-width) (width win)
    (setf (xlib:drawable-border-width win) width))

then how to call the above function? Actually, I really don’t understand what “(setf xwin-border-width)” means instead of function time?

Yours faithfully!

+3
source share
2 answers

This defines the function setf. You can call it using (setf (xwin-border-width *some-window*) width).

You can find the documentation for setfuseful: http://www.lispworks.com/documentation/lw50/CLHS/Body/m_setf_.htm

Hyperspec also has a section on generic links: http://www.lispworks.com/documentation/lw50/CLHS/Body/05_a.htm

+5
source

defun (setf f), , , setf f.

(defun foo (lst) (car lst))

(defun (setf foo) (val lst)
  (setf (car lst) val))

foo . , (setf f), , f.

setf to foo :

? (let ((z (list 1 2 3)))
     (setf (foo z) 168)
     z)
(168 2 3)

foo, `(setf foo), .

6 ANSI Common Lisp .

+1

All Articles