Re: Clojure Meetup at Pycon

2011-03-10 Thread Erik Söhnel
Hi Alex, great to hear that there are more clojurians going pycon :). I'm currently attending the pycon tutorial sessions and I'm staying until sunday the 13th. Just let me know when you're here and where to meet. Are the more clojurians wanting to join? Cheers, Erik On Mar 10, 2:26 pm, Alex Ro

Re: Records forget they are records

2010-06-21 Thread Erik Söhnel
Hi, see http://paste.pocoo.org/show/227866/ You just have to write your macro so that it expands into multiple defs. Remember, macros work at compile time, so they are not the same as eval. And from your code, I could not see your intentions, your prepare-2 macro seems somehow wrong to me. Maybe

Re: Which GUI toolkit would you like to see wrapped in an idiomatic Clojure library?

2010-05-30 Thread Erik Söhnel
I'd vote for swing and against anything that abstracts away the toolkit so that you can switch the backend. Implementing a clojure wrapper for the apache pivot toolkit gave me a little insight on at least two GUI toolkits, namely swing and pivot. Despite their goal of displaying widgets on a 2 di

Re: Macro question from a clojure newbie

2010-05-30 Thread Erik Söhnel
Hi, Not really mechanisms, but two Idioms will help you with your problem: Either wrap the defn in a let: (let [U (gen-matrix [1 2 2 -2 -1 -2 2 2 3] 3 3) A (gen-matrix [1 2 2 2 1 2 2 2 3] 3 3) D (gen-matrix [-1 -2 -2 2 1 2 2 2 3] 3 3) S (gen-vector [3 4 5])] (letfn [(prims-fro

Re: Anyone experienced in using clojure as a "database"

2010-05-30 Thread Erik Söhnel
Hi Andrzej, > I have a question about primary keys. As far as I can see you're > currently using the first field of the relation as a primary key. > While that's what other databases do (and it is working well), I think > it would be better to make _records_ themselves primary keys. Since > record

Re: Anyone experienced in using clojure as a "database"

2010-05-28 Thread Erik Söhnel
> I haven't had a chance to play with your code yet but at first glance > it looks good. Does the above mean that all set operations are > automatically supported and the accelerated? Unfortunately not for all operations. For example, clojure.set/join uses its own index function, which builds an

Re: Anyone experienced in using clojure as a "database"

2010-05-27 Thread Erik Söhnel
On 26 Mai, 15:24, Andrzej wrote: > I'd love to see a persistent "table" type together with some common > primitives (select, join, union) and optimization capabilities. > Currently a "set of maps" does something like that but I have no idea > how to, for example, add an "index" to some particula

Re: weird repl + classloader behavior

2010-05-26 Thread Erik Söhnel
On 25 Mai, 08:03, Brent Millare wrote: > Erik, what you said seems to make sense. So the question now is, since > a new classloader is started during each eval at the repl, does that > mean that it is closed after each repl statement? This seems to be the > case because after requiring a namespa

Re: API in Clojure for Java folklore

2010-05-24 Thread Erik Söhnel
hi, you could use a simple class signature generator and then run javadoc on it: (def javadoc-strings (atom {})) (defn javadoc [class name & body] (swap! javadoc-strings update-in [class] #(conj (or % []) %2) [name (apply str body)]) nil) (defn -myMethod "My cool documentation" [x y]

Re: weird repl + classloader behavior

2010-05-24 Thread Erik Söhnel
Hi, I guess clojure creates a new classloader for each eval to make redefining deftypes possible. Is your requirement somehow related to applets or webstart or other sandboxes environments? > I need a reliable method to provide enforce usage of a single > classloader for an entire session, this a