Skip to content

Instantly share code, notes, and snippets.

@citizen428
Created May 16, 2010 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save citizen428/674e091831cb7bb5d226 to your computer and use it in GitHub Desktop.
Save citizen428/674e091831cb7bb5d226 to your computer and use it in GitHub Desktop.
  • Clojure notes

  • Try Clojure

  • Incanter Infix macro

      (use 'incanter.core)
      ;; infix math
      ($= 7 + 8 - 2 * 6 / 2)
      ;; matrix operations
      ($= (matrix [[1 2] [4 5]]) + [[1 1] [1 1]])
      ;; exponents
      ($= 8 ** 3)
      ($= 9 ** 1/2)
      ;; using variables in infix
      (let [x 10
            y -5]
        ($= x + y / -10))
      ;; using Clojure math
      ($= Math/PI / 4)
      ($= sq 5)     
      ;; boolean
      ($= 5 > 3)
      ;; complex example
      (use '(incanter core charts latex))
        (doto (function-plot (fn [x] ($= x ** 3 - 5 * x ** 2 + 3 * x + 5)) -10 10)
          (add-latex 0 250 "x^3 - 5x^2 + 3x +5")
          view)
    
  • couch-fuse, clj-cassandra

  • enough is enough

  • GAE bindings

  • Joy of Clojure book promotion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment