Support the new smokegenerator (r1015073).
src/objects/enum.lisp
Thu Aug 27 13:43:13 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Support the new smokegenerator (r1015073).
* support const correctness
* remove workarounds for the old smoke
The old smoke is no longer supported.
Thanks to Arno Rehn for making the smokegenerator work with cl-smoke.
--- old-smoke/src/objects/enum.lisp 2014-10-30 08:11:28.000000000 +0100
+++ new-smoke/src/objects/enum.lisp 2014-10-30 08:11:28.000000000 +0100
@@ -44,17 +44,26 @@
(= (value enum1) (value enum2)))
(defmacro enum-xcase (case keyform &body cases)
- (let ((type (enum-type (eval (first (first cases))))))
+ (flet ((first-key (keys)
+ (if (listp keys)
+ (first keys)
+ keys)))
+ (let ((type (enum-type (eval (first-key (first (first cases)))))))
(loop for case in cases do
- (check-enum-type (eval (first case))
+ (check-enum-type (eval (first-key (first case)))
type)))
`(progn
- ; (check-enum-type (enum-type ,keyform)
- ; (enum-type ,(first (first cases))))
+ ;; (check-enum-type (enum-type ,keyform)
+ ;; (enum-type ,(first (first cases))))
(,case (value ,keyform)
,@(loop for case in cases
- collect `(,(value (eval (first case)))
- ,@(rest case))))))
+ collect `(,(if (listp (first case))
+ (mapcar #'(lambda (c)
+ (print c)
+ (value (eval c)))
+ (first case))
+ (value (eval (first case))))
+ ,@(rest case)))))))
(defmacro enum-case (keyform &body cases)
`(enum-xcase case ,keyform ,@cases))