   [mk do-add tree]
   `((do-map-tree ~mk ~do-add) ~tree))
 
-(defmacro unroll-parameters
+(defn unroll-parameters
   "Takes a vector that has a function as first argument and does a function
    call giving all other vector elements as parameters."
-  [call_vec]
-  `(let [ vec# ~call_vec
-          count# (count vec#)
-          ]
-     (cond 
-       (= count# 0) nil
-       (= count# 1) ((vec# 0))
-       (= count# 2) ((vec# 0) (vec# 1))
-       (= count# 3) ((vec# 0) (vec# 1) (vec# 2))
-       (= count# 4) ((vec# 0) (vec# 1) (vec# 2) (vec# 3))
-       (= count# 5) ((vec# 0) (vec# 1) (vec# 2) (vec# 3) (vec# 4))
-       (= count# 6) ((vec# 0) (vec# 1) (vec# 2) (vec# 3) (vec# 4) (vec# 5)))))
-
-(defmacro unroll-parameters-fn-map
+  [call_seq]
+  (let [ call_vec (vec call_seq)
+         length   (count call_vec)]
+    (when (< 0 length) (apply (call_vec 0) (rest call_vec)))))
+
+(defn unroll-parameters-fn-map
   "Takes a vector that has a function as first argument and does a function
    call giving all other vector elements as parameters, looking up the function
    in the function map"
-  [fn_map call_vec]
-  `(let [ vec# ~call_vec
-          count# (count vec#)
-          ]
-     (cond 
-       (= count# 0) nil
-       (= count# 1) ((~fn_map (vec# 0)))
-       (= count# 2) ((~fn_map (vec# 0)) (vec# 1))
-       (= count# 3) ((~fn_map (vec# 0)) (vec# 1) (vec# 2))
-       (= count# 4) ((~fn_map (vec# 0)) (vec# 1) (vec# 2) (vec# 3))
-       (= count# 5) ((~fn_map (vec# 0)) (vec# 1) (vec# 2) (vec# 3) (vec# 4))
-       (= count# 6) ((~fn_map (vec# 0)) (vec# 1) (vec# 2) (vec# 3) (vec# 4)
-                      (vec# 5)))))
+  [fn_map call_seq]
+  (let [ call_vec (vec call_seq)
+         length   (count call_vec)]
+    (when (< 0 length) (apply (fn_map (call_vec 0)) (rest call_vec)))))
 
 (defn print-doc* [v]
   (println "-------------------------")

  `(fn mapper# [tree#]
     (let [root# (~mk (first tree#))
            childs# (rest tree#)]
       (do
         (doseq [x# childs#] (~do-add root# (mapper# x#)))
         root#))))

(defmacro do-map-tree*
  "Maps a named list tree using the given functions to a new tree structure,

   with the widget as first parameter and the given additional parameters"
  [map key & parameters]
  `(((~map :handler) ~key) ~map ~@parameters))


;;;
