Re: Weird nested macro problem

2011-02-01 Thread Ken Wesson
On Wed, Feb 2, 2011 at 1:48 AM, George Jahad wrote: > As usual, Meikel has the right answer.  But I didn't quite get it at > first. > > It looks like syntax-quote generates cons's, not lists: > user> (type (nth `(handler-case :type (println "test") (~'handle foo)) > 3)) > clojure.lang.Cons > > You

Re: Weird nested macro problem

2011-02-01 Thread George Jahad
As usual, Meikel has the right answer. But I didn't quite get it at first. It looks like syntax-quote generates cons's, not lists: user> (type (nth `(handler-case :type (println "test") (~'handle foo)) 3)) clojure.lang.Cons Your macroexpand-1 example worked because the reader doesn't distinguish

Re: Clojure 1.3.0-alpha4 - number wierdness

2011-02-01 Thread Chas Emerick
The numeric coercion functions only impact interop starting in 1.3.0. If you want a concrete Integer, use (Integer. 0); if you want a float, use (Float. 6.7). Cheers, - Chas On Feb 1, 2011, at 7:12 PM, Jules wrote: > Clojure 1.2.0 > user=> (type 0) > java.lang.Integer > user=> (type (int 0))

Re: Clojure 1.3.0-alpha4 - number wierdness

2011-02-01 Thread Luc Prefontaine
On Tue, 1 Feb 2011 16:12:11 -0800 (PST) Jules wrote: > Clojure 1.2.0 > user=> (type 0) > java.lang.Integer > user=> (type (int 0)) > java.lang.Integer > user=> > > but > > Clojure 1.3.0-alpha4 > user=> (type 0) > java.lang.Long > user=> (type (int 0)) > java.lang.Long > > apologies if this is

Re: how to print-dup records?

2011-02-01 Thread Seth
Looks like it will do! One change, though, that I made for myself is that (defrecord2 (name constructor-name) [args] Protocol1 ...) so you can do protocols or (defrecord2 name [args] Protocol1...) for default -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: Clojure 1.3.0-alpha4 - number wierdness

2011-02-01 Thread Ken Wesson
On Tue, Feb 1, 2011 at 7:12 PM, Jules wrote: > Clojure 1.2.0 > user=> (type 0) > java.lang.Integer > user=> (type (int 0)) > java.lang.Integer > user=> > > but > > Clojure 1.3.0-alpha4 > user=> (type 0) > java.lang.Long > user=> (type (int 0)) > java.lang.Long > > apologies if this is a known issu

Clojure 1.3.0-alpha4 - number wierdness

2011-02-01 Thread Jules
Clojure 1.2.0 user=> (type 0) java.lang.Integer user=> (type (int 0)) java.lang.Integer user=> but Clojure 1.3.0-alpha4 user=> (type 0) java.lang.Long user=> (type (int 0)) java.lang.Long apologies if this is a known issue ... regards Jules -- You received this message because you are subsc

Helper functions for accessing properties in clojure-clr 1.2.0

2011-02-01 Thread Matthew D. Swank
AFAIK clojure-clr doesn't have built-in support for accessing properties. Something like this has probably been posted before, but I've been playing with Windows.Forms, and I found the following useful. (import '(System Type Array Exception) '(System.Reflection PropertyInfo MethodInfo)) (

a tour of Clojure (network analysis of Clojure projects)

2011-02-01 Thread Alexander Yakushev
Great work! Very informative indeed. Especially thank you for sharing with Overtone, tremendously interesting project and presentation. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note

Re: Weird nested macro problem

2011-02-01 Thread Meikel Brandmeyer
Hi, the failing part is actually not the comparison of the symbols, but the check for listness. user=> (list? (nth `(handler-case :type (println "test") (~'handle foo)) 3)) false user=> (seq? (nth `(handler-case :type (println "test") (~'handle foo)) 3)) true Sincerely Meikel -- You received

Re: LDAP library?

2011-02-01 Thread ephcon
Search on clojars returns . I've never used it and can't vouch for it. Beware, lists the following as project url: http://github.com/cageface/clojure

Re: Weird nested macro problem

2011-02-01 Thread jweiss
If I remember right from looking at clojure.contrib.condition's source (which I did because I wrote a similar error handling lib, which has a few extra features but isn't ready for prime time)... "handle" doesn't actually exist as a function or macro. It doesn't expand - the handler-case macro lo

Weird nested macro problem

2011-02-01 Thread Straszheim, Jeff
So, I have a macro that looks something like this: (defmacro test-failure [& forms] `(handler-case :type ~@forms (~'handle :error/error (println "error happened" (My real macro is more complex, but this gives the idea.) If I eval (test-failure (println "test")) I get

a handy little function I haven't seen before

2011-02-01 Thread George Jahad
get-all-fields dumps all the fields contained by the object. Handy for exploring functions with closures, like those created by partial, comp, and memoize. https://gist.github.com/806595 -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to thi

LDAP library?

2011-02-01 Thread Saul Hazledine
Hello, This question has been asked before but it was over a year ago. I need to start using Clojure with LDAP and I was wondering if anybody had written a clojure library to do this rather than using the standard Java JNDI API (which doesn't look like much fun and is a further abstraction on top

Re: How to disallow unlisted optional argument keys?

2011-02-01 Thread .Bill Smith
Yes, that's very succinct. Of course, it isn't cheap. I mean I wouldn't put it in the inner loop of Robert's image processing code. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note t