SWANK defines defstructs in the keyword package

Martin Simmons martin at lispworks.com
Mon Jul 3 16:52:26 UTC 2017


Hi,

swank/backend.lisp defines some defstructs in the keyword package:

(defstruct (:location (:type list) :named
                      (:constructor make-location
                                    (buffer position &optional hints)))
  buffer position
  ;; Hints is a property list optionally containing:
  ;;   :snippet SOURCE-TEXT
  ;;     This is a snippet of the actual source text at the start of
  ;;     the definition, which could be used in a text search.
  hints)

(defstruct (:error (:type list) :named (:constructor)) message)

;;; Valid content for BUFFER slot
(defstruct (:file       (:type list) :named (:constructor)) name)
(defstruct (:buffer     (:type list) :named (:constructor)) name)
(defstruct (:etags-file (:type list) :named (:constructor)) filename)

;;; Valid content for POSITION slot
(defstruct (:position (:type list) :named (:constructor)) pos)
(defstruct (:tag      (:type list) :named (:constructor)) tag1 tag2)


This is generally a bad idea because it can lead to clashes in the namespace
of structure names (as used by the :include option).

AFICS, except for "location", these definitions are never used because they
are always constructed using backquote or list.

Would you consider removing the defstructs and adding defuns for make-location
and its readers?

-- 
Martin Simmons
LispWorks Ltd
http://www.lispworks.com/



More information about the slime-devel mailing list