aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Olaechea <pirata@gmail.com>2020-05-16 23:35:08 -0500
committerJavier Olaechea <pirata@gmail.com>2020-05-16 23:35:08 -0500
commitec95613c14361abb3eb6956b53680ef136b37118 (patch)
treee7f5d4ebcd33d5492bdd5dac73956018d2072294
parente54216221f5eb96a671cf1e78206cccb61f113ad (diff)
downloadcl-xcb-ec95613c14361abb3eb6956b53680ef136b37118.tar.gz
Use keywords to designate XCB types
Otherwise the package the type defined in would have to export the symbol that names the type. It would also hurt discoverability as the user would have to care in which package the type was defined in. On top of that, if they are trying to access the information about a particular type they would either have to import the package or fully qualify the symbol. An alternative design would be to convert the symbols to strings before storing them so we can compare by symbol name. But that would be fighting against the design of the Common Lisp language. Keywords are meant to be used precisely for cases like this.
-rw-r--r--src/xcb/types.lisp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/xcb/types.lisp b/src/xcb/types.lisp
index 42a94a1..1e59363 100644
--- a/src/xcb/types.lisp
+++ b/src/xcb/types.lisp
@@ -79,9 +79,9 @@
(defmacro define-type-alias (new-type old-type)
`(register-type-alias ',new-type ',old-type))
-(define-type-alias cookie
- card16)
+(define-type-alias :cookie
+ :card16)
;; TODO: Check if this alias is according to the spec.
-(define-type-alias char
- card8)
+(define-type-alias :char
+ :card8)