   {:base (.GetComponent this UnityEngine.Light)
    :get (.range this)
    :tag System.Single})
+
+(defmacro AND [& more]
+  (let [syms (take (count more) (repeatedly gensym))]
+   `(~'let [~@(mapcat vector syms more)] 
+      (~'fn [] (~'and ~@(map list syms))))))
+
+(defmacro OR [& more]
+  (let [syms (take (count more) (repeatedly gensym))]
+   `(~'let [~@(mapcat vector syms more)] 
+      (~'fn [] (~'or ~@(map list syms))))))
+
+(defmacro NOT [f]
+  (let [sym (gensym)]
+   `(~'let [~sym ~f] 
+      (~'fn [] (~'not (~sym))))))
 
 '[tween.core]
 

(ns tween.core
  (:import Vector3 
    [UnityEngine HideFlags GameObject Color Vector4 Vector3 Vector2 Quaternion MonoBehaviour WaitForSeconds Time Mathf]
    [System GC Object]
    [System.Collections IEnumerator])
  (:require 

(def <over> (*TimeLineCursor 0 false))

(defn timeline [fns]
  (when (. Application isPlaying)
    (let [current (volatile! (first fns))
          fns (volatile! (rest fns))
          ^UnityEngine.MonoBehaviour coro-root (mono-obj)
          ^tween.core.TimeLineCursor cursor (*TimeLineCursor 0 false)]
      (.StartCoroutine coro-root
        (reify IEnumerator
          (MoveNext [this]
            (when-not panic
              (try 
                (set! (.v cursor) (@current))
                (if (.v cursor) true
                  (if (do (vreset! current (first @fns) )
                          (vswap! fns rest) @current)
                    true
                    (!TimeLineCursor cursor)
                    ))
                (catch Exception e false))))
          (get_Current [this] (.v cursor))))
      (fn [] (if @current true false)))))

(defn timeline-1 [fns] (timeline (map #(%) fns)))

(defn array-timeline [^clojure.lang.PersistentHashSet opts
                      ^|System.Object[]|               fns]
  (when (. Application isPlaying)
    (let [cnt (int (dec (.Length fns)))
          current (volatile! ((aget fns 0)))
          ^UnityEngine.MonoBehaviour coro-root (mono-obj)
          ^tween.core.TimeLineCursor cursor (*TimeLineCursor 0 false)]
      (.StartCoroutine coro-root
        (reify IEnumerator
          (MoveNext [this]
            (try 
              (set! (.v cursor) (@current))
              (if (.v cursor) true
                (if (>= (.i cursor) cnt) 
                    (if (opts :loop) 
                      (do (set! (.i cursor) 0)
                          (vreset! current ((aget fns 0))) true)
                      (!TimeLineCursor cursor))
                    (do (set! (.i cursor) (inc (.i cursor)))
                        (vreset! current ((aget fns (.i cursor))))
                        @current)))
              (catch Exception e false)))
          (get_Current [this] (.v cursor))))
      (fn [] (.v cursor)))))

(defmacro timeline* [& fns]
  (let [[opts fns] ((juxt (comp set filter) remove) keyword? fns)
