You can try :reader or :accessor .
Performance
(defclass some-class () ((some-slot :initarg :somearg :reader some-slot :initform (error ":somearg not specified"))))
should allow you to rewrite lines 11 through 13 as
(princ (remove-duplicates *delta* :test
That is, (some-slot x) equivalent to (slot-value x 'some-slot) if this slot has a reader / accessor.
Editing after sleep:
You also do not need to worry about the error :initform ; the slot will do this by default unless you specify a default value and someone tries to read it. If you don't want an error, you do something like :initform nil . Check out this excellent CLOS tutorial , as well as chapters 16 and 17 Practical General Lisp for more information on objects in Common Lisp.
Also, in the future, if you have working code that you would like to recommend a style for, look at codereview.stackexchange . There is a small but active population of Lisp reviewers.
source share