class loading problem in embedded clojure

2012-11-30 Thread Vladimir Tsichevski
Hi, I've embedded Clojure 1.4 with nREPL into my Eclipse RCP application. Now in nREPL I define a function which builds a menu with some actions. Everything seemes to work as expected. Now I select some menu item which executes the following code: (println PlatformUI) (println (PlatformUI/g

Re: (iterate inc 2) vs (drop 2 (range)) in corecursion

2012-11-30 Thread Christophe Grand
Hallo, On Thu, Nov 29, 2012 at 11:20 PM, Ulrich wrote: > Now should we consider this a clojure bug? > It is, see http://dev.clojure.org/jira/browse/CLJ-457 What clojure version are you using btw to get the exceptions? master from Github with my patch to CLJ-457 applied :-) Now, that's clear

Re: call superclass method in classes created by Clojure?

2012-11-30 Thread Vladimir Tsichevski
Thank you David, it works! On Thursday, November 29, 2012 5:44:06 PM UTC+4, David Powell wrote: > > proxy is basically a more interop-oriented version of reify though, and it > can extend classes, and you can use proxy-super to call superclass methods > from there. > On Nov 29, 2012 1:40 PM, "Vl

Re: Proposed change to let-> syntax

2012-11-30 Thread Rich Hickey
I'm not satisfied with the names for the new threading macros either. The new names being considered for let->, test-> and when-> are: A) let-> becomes as-> reduces arg order and destructuring expectations. B) test-> becomes cond-> cond-> was the original name, and, protestations about not sh

Re: Proposed change to let-> syntax

2012-11-30 Thread Jay Fields
On Fri, Nov 30, 2012 at 10:37 AM, Rich Hickey wrote: > The new names being considered for let->, test-> and when-> are: > > A) let-> becomes as-> I prefer ->as, but don't feel strongly about it. (-> 1 str (->as one-str (count one-str) (* 2 one-str))) ;; returns 2 The

Re: Proposed change to let-> syntax

2012-11-30 Thread Alex Baranosky
I've got a utility function I've been using called `conditionally-transform` which is a non-macro version of `test->`. I think both cond-> and if-> have a similar problem in that, if you already understand if/cond/-> then it gives you little insight into how the new threading macro works. Both th

Re: Proposed change to let-> syntax

2012-11-30 Thread Steve Miner
I propose guard-> to avoid the cond-> confusion. If we're voting, as-> is good. I liked when->. On Nov 30, 2012, at 10:37 AM, Rich Hickey wrote: > I'm not satisfied with the names for the new threading macros either. > > The new names being considered for let->, test-> and when-> are: > >

Re: Proposed change to let-> syntax

2012-11-30 Thread Ben Wolfson
On Fri, Nov 30, 2012 at 10:15 AM, Alex Baranosky wrote: > I've got a utility function I've been using called `conditionally-transform` > which is a non-macro version of `test->`. Likewise, except with use a HOF called "conditionalize": (defn conditionalize "When called with a function f, retur

Re: Proposed change to let-> syntax

2012-11-30 Thread Ben Wolfson
On Fri, Nov 30, 2012 at 10:15 AM, Alex Baranosky wrote: > I've got a utility function I've been using called `conditionally-transform` > which is a non-macro version of `test->`. Likewise, except with use a HOF: (defn conditionalize [pred f] (fn [& args] (if (apply pred args) (apply f args) (a

Re: Proposed change to let-> syntax

2012-11-30 Thread Rich Hickey
On Nov 30, 2012, at 1:15 PM, Alex Baranosky wrote: > I've got a utility function I've been using called `conditionally-transform` > which is a non-macro version of `test->`. I think both cond-> and if-> have > a similar problem in that, if you already understand if/cond/-> then it gives > you

Re: Proposed change to let-> syntax

2012-11-30 Thread Rich Hickey
On Nov 30, 2012, at 1:49 PM, Steve Miner wrote: > I propose guard-> to avoid the cond-> confusion. > Yeah, that came up. Guards in other langs are short circuiting, just like cond. Another in that camp was gate-> -- You received this message because you are subscribed to the Google Groups "C

Re: Proposed change to let-> syntax

2012-11-30 Thread Sean Corfield
On Fri, Nov 30, 2012 at 7:37 AM, Rich Hickey wrote: > A) let-> becomes as-> > Fine with that. > B) test-> becomes cond-> > Fine with that (because I can't think of anything better). > C) when-> becomes some-> > > and in doing so, tests for non-nil rather than truth. > Given that some-> thr

math expression simplifier, kibit implementation

2012-11-30 Thread Brent Millare
Hey all, Before I diving in detail into the code, can someone provide me a high level explanation of how kibit simplifies code? I understand underneath it uses core.logic and rules but its not clear to me how it picks one form over the other. I'm trying to extend this to data that represents m

Re: ANN - Conjure 2.1.1 - Lightweight mocking library

2012-11-30 Thread John Gabriele
On Tuesday, November 27, 2012 3:22:29 AM UTC-5, Alex Baranosky wrote: > > Conjure is a lightweight mocking library intended to be used on top of > clojure.test. > > We've been using it at Runa for a long time, and it is compatible with all > versions of Clojure from 1.2 to 1.5-beta1. > > https://

Re: Proposed change to let-> syntax

2012-11-30 Thread Alex Baranosky
gate-> is an interesting possiblity. On Fri, Nov 30, 2012 at 1:53 PM, Sean Corfield wrote: > On Fri, Nov 30, 2012 at 7:37 AM, Rich Hickey wrote: > >> A) let-> becomes as-> >> > > Fine with that. > > >> B) test-> becomes cond-> >> > > Fine with that (because I can't think of anything better). > >

First test with JavaFx and blocked yet :(

2012-11-30 Thread Christian Sperandio
Hi, I'm testing JavaFX with Clojure 1.4 and I've got some issues. I wrote this code: (ns test-javafx2-clj.core (:import javafx.application.Application javafx.stage.Stage (javafx.scene Parent Scene)) (:gen-class :extends javafx.application.Application)) (defn -main

Clamq - simple clojure test to send/receive message over activemq

2012-11-30 Thread shuaybi
Can someone please look at the below code to see why it is not working. I am trying to write simple clojure code to send/receive message over activemq. I am starting two REPL sessions and loading the same code below in each session. In one session I invoke the start-consumer function and in the

Re: First test with JavaFx and blocked yet :(

2012-11-30 Thread Kevin Downey
javafx.application.Application/launch is looking at the class that the method that calls it belongs to, in this case it belongs to the IFn class generated for the -main function, there is an arity for launch that takes the class you want to use instead of the weird detection thing On Fri, Nov

Re: First test with JavaFx and blocked yet :(

2012-11-30 Thread Kevin Downey
here is an example https://gist.github.com/4179694 On Fri, Nov 30, 2012 at 4:13 PM, Kevin Downey wrote: > javafx.application.Application/launch is looking at the class that the > method that calls it belongs to, in this case it belongs to the IFn class > generated for the -main function, there

Re: [ANN] ClojureScript release 0.0-1535 with G.Closure 0.0-2029

2012-11-30 Thread David Nolen
Can we move forward on this? Option 1 seems best to me. That said what's the compelling reason these days for lein-cljsbuild to depend on a specific version of ClojureScript? Are you relying on certain aspects of the analyzer or compiler's API and find that they change quite frequently? On Fri, N

CLJS: extending types like keyword, symbol and string?

2012-11-30 Thread Frank Siebenlist
When I ask for the type of a keyword, symbol or string, cljs gives me the same answer: --- ClojureScript:cljs.user> (type "jaja") # ClojureScript:cljs.user> (type 'jaja) # ClojureScript:cljs.user> (type :jaja) # ClojureScript:cljs.user> (= (type :jaja)(type 'jaja)(type "jaja")) true --- but the

Re: CLJS: extending types like keyword, symbol and string?

2012-11-30 Thread Frank Siebenlist
Sorry - just noticed the "Re: cljs: extend-protocol to Keyword" discussion of a few days ago. Maybe we should start maintaining an FAQ-like wiki-page with summaries of those issues/features… -FS. On Nov 30, 2012, at 5:17 PM, Frank Siebenlist wrote: > When I ask for the type of a keyword, s

Re: Clojure CLR and System.Double Behavior

2012-11-30 Thread dmiller
Patched in master branch. Clojure 1.5.0-master-SNAPSHOT user=> user=> (defn bar [^Double d] d) #'user/bar user=> (defn baz [^System.Double d] d) #'user/baz user=> (bar 1.2) 1.2 user=> (baz 1.2) 1.2 user=> (defprotocol FP (foo [_])) FP user=> (extend-protocol FP System.Double (foo [d] d)) nil user=

Re: math expression simplifier, kibit implementation

2012-11-30 Thread Jonas
Hi The function `simplify-one` in kibit.core is the “brain” behind kibit: (defn simplify-one [expr rules] (let [alts (logic/run* [q] (logic/fresh [pat subst] (logic/membero [pat subst] rules) (logic/project [pat subst] (logic/all (pat expr)