Permalink
Browse files

enabled to omit empty 'defcontext', then 'defslides' calls 'defcontex…

…t' first and default settings will be used.
  • Loading branch information...
fukamachi committed Dec 23, 2010
1 parent aa6e730 commit 29046ba692cef595d7bfc2c6aba9ecd2abfbdfe6
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/L5.clj
View
@@ -22,7 +22,9 @@
(dosync (ref-set *context* (context/make-context ~params)))))
(defmacro defslides [& slides]
- `(dosync (ref-set (:slides (context)) [~@slides])))
+ `(do
+ (if (not (context)) (defcontext {}))
+ (dosync (ref-set (:slides (context)) [~@slides]))))
(defn- map-set! [obj-map key val]
(dosync (ref-set (get obj-map key) val)))

0 comments on commit 29046ba

Please sign in to comment.