Re: throw-if with no exception class

2008-12-12 Thread Ralf Bensmann
Hi Rich, I am very interested in your view of the world - why are 'checked' exceptions evil? Thanks -Ralf On Thu, Dec 11, 2008 at 2:08 PM, Rich Hickey wrote: > > > > On Dec 10, 10:52 pm, "Stephen C. Gilardi" wrote: > > On Dec 10, 2008, at 4:38 AM, Ralf

Re: throw-if with no exception class

2008-12-11 Thread Ralf Bensmann
tion is to use RuntimeException. -Ralf On Thu, Dec 11, 2008 at 4:52 AM, Stephen C. Gilardi <[EMAIL PROTECTED]>wrote: > > On Dec 10, 2008, at 4:38 AM, Ralf Bensmann wrote: > > Being a Java trainer for a long time, we talk with students about the > "handle-or-declar

Re: throw-if with no exception class

2008-12-10 Thread Ralf Bensmann
Being a Java trainer for a long time, we talk with students about the "handle-or-declare rule" in Java and the two types of exceptions: "checked" (declared) and "unchecked" (runtime). So I prefer using a RuntimeException because no exception was specified. On Wed, Dec 10, 2008 at 3:46 AM, Mark Vol

Re: Bug: recur won't work in tail position within cond

2008-12-05 Thread Ralf Bensmann
In Clojure the extra () around case and expr are skipped if no function call is made. Have a look at clojure.org/api -Ralf On Thu, Dec 4, 2008 at 5:54 AM, harrison clarke <[EMAIL PROTECTED]> wrote: > did cond change syntax? > > last i checked, it was > > (cond (case) (expr) > > (case) (e

Re: Surprise effect

2008-12-04 Thread Ralf Bensmann
Just thought the same... But when I use quoting there is always a whitespace before the quote to seperate it from the preceding text. Is this a misleading behavior of the reader, or a feature? ;) -Ralf On Thu, Dec 4, 2008 at 10:50 AM, Meikel Brandmeyer <[EMAIL PROTECTED]> wrote: > > Hi, > > On 4

Re: Lazy living, without variables

2008-12-01 Thread Ralf Bensmann
Hm... this way you have to setup a ref and a transaction, but its local: user=> (let [a (ref 0)] (dosync (ref-set a 1))) 1 user=> a java.lang.Exception: Unable to resolve symbol: a in this context (NO_SOURCE_FILE:0) -Ralf On Mon, Dec 1, 2008 at 10:07 PM, jim <[EMAIL PROTECTED]> wrote: > > The rul

Re: NullPointer when just returning nil?

2008-11-29 Thread Ralf Bensmann
I think the NullPointerException was misleading for me... a more informational error message should be added. Rich, what do you think? On Sat, Nov 29, 2008 at 3:41 PM, Ralf Bensmann <[EMAIL PROTECTED]>wrote: > Argl... just forgot one of the "basic rules" ;) > > > On

Re: NullPointer when just returning nil?

2008-11-29 Thread Ralf Bensmann
Argl... just forgot one of the "basic rules" ;) On Sat, Nov 29, 2008 at 3:33 PM, Randall R Schulz <[EMAIL PROTECTED]> wrote: > > On Saturday 29 November 2008 06:27, Ralf Bensmann wrote: > > Thanks for clarification. But I am wondering about a function can > &

Re: NullPointer when just returning nil?

2008-11-29 Thread Ralf Bensmann
(NO_SOURCE_FILE:25) Thanks -Ralf On Sat, Nov 29, 2008 at 3:18 PM, Rich Hickey <[EMAIL PROTECTED]> wrote: > > > > On Nov 29, 9:06 am, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote: > > On Nov 29, 2008, at 8:03 AM, Ralf Bensmann wrote: > > > > > But

Re: NullPointer when just returning nil?

2008-11-29 Thread Ralf Bensmann
But #(...) and (fn [] ...) should be the same? On Sat, Nov 29, 2008 at 1:48 PM, Parth Malwankar <[EMAIL PROTECTED]>wrote: > > On Nov 29, 5:29 pm, "Ralf Bensmann" <[EMAIL PROTECTED]> > wrote: > > Hi, > > > > is this the intended behavior? > &g

NullPointer when just returning nil?

2008-11-29 Thread Ralf Bensmann
Hi, is this the intended behavior? user=> #(nil) java.lang.NullPointerException (NO_SOURCE_FILE:12) user=> (def b #(nil)) java.lang.NullPointerException (NO_SOURCE_FILE:13) This works: user=> #('nil) # Thanks, -Ralf --~--~-~--~~~---~--~~ You received this messag

Re: Poll: Which clojure.contrib libs should be bundled with Clojure?

2008-11-26 Thread Ralf Bensmann
? On Mon, Nov 24, 2008 at 4:02 PM, Ralf Bensmann <[EMAIL PROTECTED]> wrote: > Can you provide a "summary" of the libs? Or where can I find a > documentation? > TIA > > > On Mon, Nov 24, 2008 at 3:51 PM, Chouser <[EMAIL PROTECTED]> wrote: > >> >

Re: Dynamically name a var

2008-11-23 Thread Ralf Bensmann
Sure, but I plan to have many maps. So one map with many maps as values... hm Anyway, I just play around... -Ralf On Sun, Nov 23, 2008 at 8:43 PM, Stuart Sierra <[EMAIL PROTECTED]>wrote: > > On Nov 23, 12:37 pm, "Ralf Bensmann" <[EMAIL PROTECTED]> > wrote

Re: macroexpand-1 does not expand?

2008-11-23 Thread Ralf Bensmann
Sorry! Yes I missed the backqoute... user=> (macroexpand-1 `(t "c" 0)) (def *c* 0) On Sun, Nov 23, 2008 at 6:48 PM, Ralf Bensmann <[EMAIL PROTECTED]>wrote: > Just saw that macroexpand-1 doesn't work: > > user=> (defmacro t [n v] `(def ~(symbol (str "

macroexpand-1 does not expand?

2008-11-23 Thread Ralf Bensmann
Just saw that macroexpand-1 doesn't work: user=> (defmacro t [n v] `(def ~(symbol (str "*" n "*")) ~v)) nil user=> (t "bb" 0) #'user/*bb* user=> *bb* 0 user=> (macroexpand-1 (t "c" 0)) #'user/*c* Or am I missing something? -Ralf --~--~-~--~~~---~--~~ You received

Dynamically name a var

2008-11-23 Thread Ralf Bensmann
Hi all, how can I create a var with a "dynamic name for a symbol" using the def special form? I tried: user=> (def (symbol "user" "a") 0) java.lang.Exception: Second argument to def must be a Symbol (NO_SOURCE_FILE:44) Thanks, -Ralf --~--~-~--~~~---~--~~ You rece

Re: Eclipse Plugin- any plans for this?

2008-11-21 Thread Ralf Bensmann
Take a look at enclojure http://www.enclojure.org (despite it'a NetBeans plugin) On Fri, Nov 21, 2008 at 9:25 AM, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > > Like it says, I was just curious if any work had been done to > integrate Clojure with the Eclipse environment? It's pretty well the

Re: Exact definition of _

2008-11-20 Thread Ralf Bensmann
It is used as an "anonymous variable", when you don't care of a value: user=> (let [myfn (fn [a b] (#(+ a b)))] (reduce myfn '(1 2 3 4 5))) 15 user=> (let [myfn (fn [a _] (#(+ a a)))] (reduce myfn '(1 2 3 4 5))) 16 On Thu, Nov 20, 2008 at 11:32 AM, Timothy Pratley <[EMAIL PROTECTED]>wrote: > >> >