 ;; used by functions in this lib. Use binding to set it
 ;; to an instance of processing.core.PApplet
 (def #^PApplet *applet*)
+
+(def #^{:private true} toupper (memfn toUpperCase))
+
+(defn- tosymb [kw]
+  (-> kw name toupper symbol))
 
 (defn abs-int [n] (PApplet/abs (int n)))
 


(defn end-raw [] (.endRaw *applet*))

(defn end-shape
  ([] (.endShape *applet*))
  ([mode] (.endShape *applet* (int mode))))

;; $$exec



;; $$beginRecord

(def shapes {:points POINTS
             :lines LINES
             :triangles TRIANGLES
             :triangle-strip TRIANGLE_STRIP
             :triangle-fan TRIANGLE_FAN
             :quads QUADS
             :quad-strip QUAD_STRIP})

(defmacro begin-shape
  "Takes an optional keyword argument:  One  of: :points, :lines, :triangles,
  :triangle-fan, :triangle-strip, :quads, :quad-strip."
  ([] `(.beginShape *applet*))
  ([kind] 
     (let [kind (shapes kind)]
       `(.beginShape *applet* (int ~kind)))))

(defn bezier
  ([x1 y1 x2 y2 x3 y3 x4 y4]
