I'm trying to use the units library but am running into issues testing
the example posted here:
http://onclojure.com/2010/03/23/computing-with-units-and-dimensions/

I've reproduced the issue in leiningen
My example is a file called helloworld.clj:

(clojure.core/use 'nstools.ns)
(ns+ helloworld
     (:gen-class)
     (:clone nstools.generic-math)
     (:from units dimension? in-units-of)
     (:require [units.si :as si]))

(defn spring
  [k]
  {:pre [(dimension? (/ si/force si/length) k)]}
  (fn [x]
    {:pre [(si/length? x)]}
    (- (* k x))))
(def a-spring (spring (/ (* 5 si/N) si/cm)))


(defn -main [& args]
  (prn (a-spring (si/cm 1/2)))))


And my project.clj is:

(defproject foo "0.1"
  :dependencies [[org.clojure/clojure
                  "1.2.0-master-SNAPSHOT"]
                 [org.clojure/clojure-contrib
                  "1.2.0-SNAPSHOT"]
                 [units
                  "0.2.0"]
                 [nstools
                  "0.2.3"]]
      :main helloworld)

Running "lein compile" gives me the error:
[null] Compiling helloworld
     [null] Exception in thread "main"
java.lang.IllegalArgumentException: Unsupported option(s) - :as
(helloworld.clj:2)
     [null]     at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:
2855)
     [null]     at clojure.lang.Compiler.compile1(Compiler.java:5855)
     [null]     at clojure.lang.Compiler.compile1(Compiler.java:5845)
     [null]     at clojure.lang.Compiler.compile(Compiler.java:5914)
     [null]     at clojure.lang.RT.compile(RT.java:366)
     [null]     at clojure.lang.RT.load(RT.java:405)


Looking at the ns.clj source, it appears the library delegates to
clojure's require function:

(def #^{:private true} reference-map
  {:clone 'nstools.ns/clone
   :from 'nstools.ns/from
   :gen-class 'clojure.core/gen-class
   :import 'clojure.core/import
   :like 'nstools.ns/like
   :load 'clojure.core/load
   :refer 'clojure.core/refer
   :refer-clojure 'clojure.core/refer-clojure
   :remove 'nstools.ns/remove-from-ns
   :require 'clojure.core/require
   :use 'clojure.core/use})

Has anyone run into this issue before?

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to