chiark
/
gitweb
/
~mdw
/
clg
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a6e13fb
)
Made it possible to use regular symbols in enum and flags definitions
author
espen
<espen>
Mon, 14 Feb 2005 00:43:43 +0000
(
00:43
+0000)
committer
espen
<espen>
Mon, 14 Feb 2005 00:43:43 +0000
(
00:43
+0000)
glib/genums.lisp
patch
|
blob
|
blame
|
history
diff --git
a/glib/genums.lisp
b/glib/genums.lisp
index d8c89a67e768a02c34d41c462c333fb781328608..7e2edc41acd607325a466f0f9352bf923289ba50 100644
(file)
--- a/
glib/genums.lisp
+++ b/
glib/genums.lisp
@@
-15,7
+15,7
@@
;; License along with this library; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
;; License along with this library; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-;; $Id: genums.lisp,v 1.
9 2005/02/11 19:09:38
espen Exp $
+;; $Id: genums.lisp,v 1.
10 2005/02/14 00:43:43
espen Exp $
(in-package "GLIB")
(in-package "GLIB")
@@
-29,8
+29,9
@@
(defun %map-enum (mappings op)
(unless (atom mapping)
(setq value (second mapping)))
(ecase op
(unless (atom mapping)
(setq value (second mapping)))
(ecase op
- (:symbol-int (list symbol value))
- (:int-symbol (list value symbol))
+ (:symbol-int `(,symbol ,value))
+ (:int-symbol `(,value ,symbol))
+ (:int-quoted-symbol `(,value ',symbol))
(:symbols symbol)))))
(deftype enum (&rest args)
(:symbols symbol)))))
(deftype enum (&rest args)
@@
-53,8
+54,8
@@
(defmethod to-alien-form (form (type (eql 'enum)) &rest args)
(defmethod from-alien-form (form (type (eql 'enum)) &rest args)
(declare (ignore type))
(defmethod from-alien-form (form (type (eql 'enum)) &rest args)
(declare (ignore type))
- `(
e
case ,form
- ,@(%map-enum args :int-symbol)))
+ `(case ,form
+ ,@(%map-enum args :int-
quoted-
symbol)))
(defmethod to-alien-function ((type (eql 'enum)) &rest args)
(declare (ignore type))
(defmethod to-alien-function ((type (eql 'enum)) &rest args)
(declare (ignore type))
@@
-106,8
+107,8
@@
(defun ,enum-int (enum)
,@(%map-enum args :symbol-int)
(t (error 'type-error :datum enum :expected-type ',name))))
(defun ,int-enum (value)
,@(%map-enum args :symbol-int)
(t (error 'type-error :datum enum :expected-type ',name))))
(defun ,int-enum (value)
- (
e
case value
- ,@(%map-enum args :int-symbol)))
+ (case value
+ ,@(%map-enum args :int-
quoted-
symbol)))
(defmethod to-alien-form (form (type (eql ',name)) &rest args)
(declare (ignore type args))
(list ',enum-int form))
(defmethod to-alien-form (form (type (eql ',name)) &rest args)
(declare (ignore type args))
(list ',enum-int form))
@@
-142,8
+143,8
@@
(defun %map-flags (mappings op)
(unless (atom mapping)
(setq value (second mapping)))
(ecase op
(unless (atom mapping)
(setq value (second mapping)))
(ecase op
- (:symbol-int
(list symbol
value))
- (:int-symbol
(list value
symbol))
+ (:symbol-int
`(,symbol ,
value))
+ (:int-symbol
`(,value ,
symbol))
(:symbols symbol)))))
(deftype flags (&rest args)
(:symbols symbol)))))
(deftype flags (&rest args)