Re: Clojure can't import some Java classes

2013-10-12 Thread Wujek Srujek
So you are saying compilation is trying to instantiate class and run static initializers? This seems very backward, are you sure? On Sat, Oct 12, 2013 at 8:30 AM, Zach Oakes wrote: > I should add, I am aware I can bring in a class dynamically with > Class/forName, and that is what I ended up do

Re: Coding while running the program

2013-03-23 Thread Wujek Srujek
I have no idea what the guy uses, neither am I a big fan of Eclipse as a tool for anything, but the one tool I do use on a daily basis is JRebel. It is basically a very smart classloader that observes the filesystem for newly compiled classes / copied resources (that happens on save in Eclipse, for

Re: macro: retrieving metadata for an object bound to a symbol passed as argument

2013-01-14 Thread Wujek Srujek
et's see how it works: > > user=> (def my-name "JIM") > #'user/my-name > user=> (defrecord NAME [^String s]) > user.NAME > user=> (def your-name (NAME. "Wujek" {:surname "Srujek"} nil)) ;;your-name > has meta-data > #'user/

Re: macro: retrieving metadata for an object bound to a symbol passed as argument

2013-01-14 Thread Wujek Srujek
gumentException Jim seems not be our object user/with-obj > (NO_SOURCE_FILE:3) > user=> (macroexpand '(with-obj (with-meta (Foo. 'x 'y) {:t 1 :p 2}))) > #user.Foo{:a x, :b y} > > So now you get the exception or the actual object at macro-expansion > time...Doe

Re: macro: retrieving metadata for an object bound to a symbol passed as argument

2013-01-14 Thread Wujek Srujek
set up by with-monad are nils. (domonad uses with-monad under the hood.) If I perform my check, I will be able to give a much nicer error message, and there is a lot value in that. wujek On Mon, Jan 14, 2013 at 3:45 PM, Wujek Srujek wrote: > Because this is not the whole functionality ;d The

Re: macro: retrieving metadata for an object bound to a symbol passed as argument

2013-01-14 Thread Wujek Srujek
Because this is not the whole functionality ;d The check is just a fragment, the one that doesn't work. There is much more to it, like taking the object, taking some keys and values and using them in (let) and then executing some code in this context (which is another parameter, which is not in my

Re: macro: retrieving metadata for an object bound to a symbol passed as argument

2013-01-14 Thread Wujek Srujek
Thanks. If I use syntax-quoting, the error will be checked only at the time of executing the (macro-expanded) code, not at macro-expansion time, like some other checks I am performing. Is it possible to achieve what I want while the macro is called? The checks I am performing are some semantic chec

macro: retrieving metadata for an object bound to a symbol passed as argument

2013-01-14 Thread wujek . srujek
Hi. I am writing a small library (for learning purposes) and there are a few macros. I have a macro that defines some object with the user-specified name and internal some metadata: (defmacro defobj [name operations] ; operations is a map `(def ~name (with-meta ~operations {::my-obj true}))) T

clojure.core/ns documentation glitch?

2013-01-09 Thread wujek . srujek
The documentation of clojure.core/ns says nearly to the end of its docstring: "If :refer-clojure is not used, a default (refer 'clojure) is used." Shouldn't it say that a default (refer 'clojure.core) is used? -- You received this message because you are subscribed to the Google Groups "Cloju

Re: All the ways to define metadata (and ^:static)

2013-01-09 Thread Wujek Srujek
So take this definition from master: (def ^{:arglists '([x]) :doc "Return true if x implements ISeq" :added "1.0" :static true} seq? (fn ^:static seq? [x] (instance? clojure.lang.ISeq x))) static is used twice here. What is / was the difference? Is it correct to say that it is now just

Re: All the ways to define metadata (and ^:static)

2013-01-09 Thread Wujek Srujek
Thanks. Yes, I know about ^String being ^{:tag String} because it is mentioned all over the place. ^:dynamic is not. Thanks for the links, I haven't seen them before, and they do clear this issue up. On Wed, Jan 9, 2013 at 10:03 AM, Andy Fingerhut wrote: > > On Jan 9, 2013, at 12:37 AM, wujek.sr

All the ways to define metadata (and ^:static)

2013-01-09 Thread wujek . srujek
Hi. I am currently learning clojure, which is a nice experience, but you all know that. I have question about certain metadata definitions, which I couldn't find a straight answer to on the net, and in none of the books I'm reading: 1. is ^:dynamic the same as ^{:dynamic true}, just a shortcut? 2