1. Krešimir Šojat
  2. neman

Commits

Kresimir Sojat  committed fe90c02

Fixed small error when setting default values for context map in xml templates.

  • Participants
  • Parent commits 16f4676
  • Branches default

Comments (0)

Files changed (1)

File src/net/ksojat/neman/xml.clj

View file
  • Ignore whitespace
 
 (defn context-bindings [bindings]
   (let [as-kw  #(keyword (name %))
-        expand (fn ([a1]       [a1 `(context ~(as-kw a1))])
+        expand (fn ([a1]       [a1 `(get context ~(as-kw a1))])
                    ([a1 a2]    (if (symbol? a1)
-                                 [a1 `(context ~(as-kw a1) (str ~a2))]
-                                 [a1 `(context ~(as-kw a2))]))
-                   ([a1 a2 a3] [a1 `(context ~(as-kw a2) (str ~a3))]))]
+                                 [a1 `(get context ~(as-kw a1) ~a2)]
+                                 [a1 `(get context ~(as-kw a2))]))
+                   ([a1 a2 a3] [a1 `(get context ~(as-kw a2) ~a3)]))]
     (vec (mapcat
            (fn [v]
             (if (vector? v) (apply expand v) (apply expand v '())))