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

2012-11-13 Thread Herwig Hochleitner
I've seen this same NPE in my project. I managed to work around it by
temporarily throwing out the browser repl. It seems to trigger the NPE. Not
sure how and why.


2012/11/13 Evan Mezeske 

> The policy is: update the default version as quickly as possible when a
> new ClojureScript compiler revision is released.  So, feel free to poke me
> if it seems like I haven't noticed a new release (as I might not have!).  :)
>
> Unfortunately, after setting the default ClojureScript version to
> 0.0-1535, the lein-cljsbuild simple project compiles fine, but attempting
> to compile the advanced project results in a NullPointerException:
>
> https://github.com/emezeske/lein-cljsbuild/issues/155
>
> This is going to take some debugging -- I'm not comfortable releasing
> lein-cljsbuild until both example projects compile and run cleanly.  If
> anyone has insight into the problem, that would be great.
>
> -Evan
>
> --
> 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 that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ClojureScript] Single Output File for Multiple Pages or Multiple Output Files?

2012-11-13 Thread Mimmo Cosenza
Hi Zhao,
sorry to be so late, but I did not see your question until now. I was 
investigating a similar issue in writing a short series of clojurescript 
tutorials (https://github.com/magomimmo/modern-cljs). 

The problem of sharing in more pages the same js emitted by the 
clojurescript/closure compilers could be solved, in my case, just removing 
from the cljs code any js/window setting of properties (i.e. onload) and 
putting that (e.g (set! (.-onload js/windows) init)  call directly in a 
script tag in the corresponding  html pages as:

modern_cljs.login.init();

and 

modern_cljs.shopping.init():

If you take a look to the last published tutorial (i.e. tutorial 5) in 
https://github.com/magomimmo/modern-cljs 
you can find the context I'm talking about. 

HIH

Mimmo




On Tuesday, August 14, 2012 8:04:20 PM UTC+2, Zhao Shenyang wrote:
>
> Hi All,
>
> I'm building a website using noir as the backend and clojurescript as the 
> front end language. Instead of making a single page web application, I want 
> to split the application into different pages.
>
> Now the problem is, different pages need different js functions. I know 
> that by using cljsbuild  I can build different source paths to different js 
> files. So for each pages I can just make a cljs directory and let cljsbuild 
> compile it to a js file to be included by that page. However I wonder if 
> this solution is a little bit overkill for a simple website. Maybe I can 
> put all the cljs file in one directory (hence only produce one js file) and 
> use namespace to split functions for different pages.
>
> What solution do you use? Do you think your solution is better than the 
> other one? I want to hear your opinion. Thanks.
>
> regards,
> Zhao Shenyang
>
>
>

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Clojurescript/facebook JS-SDK

2012-11-13 Thread Mimmo Cosenza
Hi Kris,
sorry to be so late to thank you. For reasons I don't know I read your 
answer just know. I think you're right in suggesting jayq. At the moment 
I'm investigating domina, but as soon as I'll come back to js-sdk 
integration I'll follow your  suggestion.

thanx again

Mimmo


On Friday, September 14, 2012 1:12:13 PM UTC+2, Kris Jenkins wrote:
>
> Hi Mimmo,
>
> I don't really have an answer to this, but I share your interest in the 
> question.
>
> The only thing I can suggest is taking a look at 
> Jayq. 
> It's a ClojureScript wrapper around jQuery. It wrapping a large & complex 
> existing JavaScript API, successfully, so it might be a good place to look 
> for guidance/inspiration...
>
> Kris
>
> On Wednesday, 12 September 2012 19:24:52 UTC+1, Mimmo Cosenza wrote:
>>
>> Hi everyone, I'm pretty new with cljs and perhaps I'm asking something 
>> very stupid. I'd like to know if integrating facebook js-sdk with cljs 
>> could be a feaseable approach to be able to write fb app using clojure on 
>> both fe and be side. I don't know if fb js-sdk is google-closure compatible 
>> with :advance closure compilation option (I even don't hope that), but by 
>> what I understood about external js library it should be possible anyway. 
>> I'm completely out of my mind?
>>
>> thanx for you attention
>>
>> Mimmo
>>
>>
>>

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

question concerning macros by a newbie

2012-11-13 Thread Johannes
Hi,

I define a record
(defrecord point [x y])

and the following macro:

(defmacro drg
  [typename components]
  `(def ~(symbol (str typename "-" (str (first components
 (fn [~(symbol "obj")] (get ~(symbol "obj") ~(symbol (str ":" (str 
(first components

the call 
user> (macroexpand-1 '(drg point [x y]))

delivers what I expect:
(def point-x (clojure.core/fn [obj] (clojure.core/get obj :x)))

Evalutating this expression at the repl delivers what I expect:
user> (def point-x (clojure.core/fn [obj] (clojure.core/get obj :x)))
#'user/point-x

But calling the macro results in an error message:
user> (drg point [x y])
CompilerException java.lang.RuntimeException: Unable to resolve symbol: :x 
in this context, compiling:(NO_SOURCE_PATH:1) 

Can anyone tell me what my mistake is?

Johannes

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: question concerning macros by a newbie

2012-11-13 Thread Christophe Grand
(symbol (str ":" (str (first components should be (keyword (first
components))
In your expansion, :x is not a keyword but a symbol starting by a colon --
the symbol fn performs no validation on its input.
When you copied/pasted it for evaluation it was then read as a keyword.

Btw I'm a little worried: are you planning to generate accessors for your
fields or are you just toying with macros?

hth,

Christophe


On Tue, Nov 13, 2012 at 11:06 AM, Johannes  wrote:

> Hi,
>
> I define a record
> (defrecord point [x y])
>
> and the following macro:
>
> (defmacro drg
>   [typename components]
>   `(def ~(symbol (str typename "-" (str (first components
>  (fn [~(symbol "obj")] (get ~(symbol "obj") ~(symbol (str ":" (str
> (first components
>
> the call
> user> (macroexpand-1 '(drg point [x y]))
>
> delivers what I expect:
> (def point-x (clojure.core/fn [obj] (clojure.core/get obj :x)))
>
> Evalutating this expression at the repl delivers what I expect:
> user> (def point-x (clojure.core/fn [obj] (clojure.core/get obj :x)))
> #'user/point-x
>
> But calling the macro results in an error message:
> user> (drg point [x y])
> CompilerException java.lang.RuntimeException: Unable to resolve symbol: :x
> in this context, compiling:(NO_SOURCE_PATH:1)
>
> Can anyone tell me what my mistake is?
>
> Johannes
>
> --
> 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 that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en




-- 
Professional: http://cgrand.net/ (fr)
On Clojure: http://clj-me.cgrand.net/ (en)

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: question concerning macros by a newbie

2012-11-13 Thread Jim foo.bar
You can't convert to keyword simply by (str ":" (str (first 
components))...you need the (keyword (first components))...also why is 
your argument (symbol "obj")? I'd prefer obj# or (gensym obj)...


Jim

On 13/11/12 10:06, Johannes wrote:

Hi,

I define a record
(defrecord point [x y])

and the following macro:

(defmacro drg
  [typename components]
  `(def ~(symbol (str typename "-" (str (first components
 (fn [~(symbol "obj")] (get ~(symbol "obj") ~(symbol (str ":" (str 
(first components


the call
user> (macroexpand-1 '(drg point [x y]))

delivers what I expect:
(def point-x (clojure.core/fn [obj] (clojure.core/get obj :x)))

Evalutating this expression at the repl delivers what I expect:
user> (def point-x (clojure.core/fn [obj] (clojure.core/get obj :x)))
#'user/point-x

But calling the macro results in an error message:
user> (drg point [x y])
CompilerException java.lang.RuntimeException: Unable to resolve 
symbol: :x in this context, compiling:(NO_SOURCE_PATH:1)


Can anyone tell me what my mistake is?

Johannes
--
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 that posts from new members are moderated - please be patient 
with your first post.

To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en 


--
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: question concerning macros by a newbie

2012-11-13 Thread Thorsten Wilms

On 11/13/2012 11:06 AM, Johannes wrote:

I define a record
(defrecord point [x y])

and the following macro:

(defmacro drg
   [typename components]
   `(def ~(symbol (str typename "-" (str (first components
  (fn [~(symbol "obj")] (get ~(symbol "obj") ~(symbol (str ":" (str
(first components



But calling the macro results in an error message:
user> (drg point [x y])
CompilerException java.lang.RuntimeException: Unable to resolve symbol:
:x in this context, compiling:(NO_SOURCE_PATH:1)

Can anyone tell me what my mistake is?


I guess the problem is that you created :x using symbol, so it is not 
recognized as a key.


But the whole approach, starting with creating names to def to inside a 
macro, is troublesome. This makes it hard to follow what's going on. If 
you provide a larger context of what you are trying to accomplish, I'm 
sure someone can suggest a much better approach.



--
Thorsten Wilms

thorwil's design for free software:
http://thorwil.wordpress.com/

--
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Interactive form workflow with Friend, can't log in

2012-11-13 Thread Haim Ashkenazi
Hi

On Mon, Nov 12, 2012 at 9:23 PM, Thorsten Wilms  wrote:

> On 11/12/2012 03:20 PM, Chas Emerick wrote:
>
>> Looks like you're not using the keyword-params middleware, which
>> Friend requires (among others).  Please check the last paragraph in
>> the 'Authentication' section here:
>>
>> https://github.com/cemerick/**friend/#authentication
>>
>> Once you add that, then the interactive-form middleware will pick up
>> the form data you're submitting.
>>
>
> I tried to make sense of that in wrapping my main handler in authenticate
> in wrap-keyword-params, later also adding wrap-session, wrap-params and
> wrap-nested params.
>
> I still get a redirect to http://localhost:8080/login?&**
> login_failed=Y&username=
>
> So please, how/where shall I *add* wrap-keyword-params (and the others?)
> exactly?

Here's how you wrap your application with middleware (root-routes is your
main routes:

(def app
  (-> #'root-routes
   (friend/authenticate …)
   (wrap-keyword-params)
   (wrap-params)
   …))

Now following your example you can
(web/start app)

note that the above set of middleware are just sample. I have no idea if
this is all you need. If you'll use the hiccup library you have a
'handler/site' function that includes many of the required middleware you
need for a website (you can also just check the documentation to see the
list of middleware it uses).

In order to learn more about middleware check the *middleware* section here:
https://github.com/ring-clojure/ring/wiki/Concepts

Also, the friend repository has a mock application you can check:
https://github.com/cemerick/friend/blob/master/test/test_friend/mock_app.clj

HTH
-- 
Haim

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

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

2012-11-13 Thread Herwig Hochleitner
I've debugged a bit, the underlying cause seems to be that
goog.net.xpc.CrosspageChannel uses goog.async.Deferred, which lives in
third_party.
In my project, I could indeed successfully compile again with the browser
repl, by adding the third-party jar.

This leaves two open issues:

Why the NPE in cljsbuild?
script/cljsc complains about goog.async.Deferred never provided, as it
should. When compiling with cljsbuild, however, the js-sources list
contains an entry which :provides goog.async.Deferred but has an :uri of
nil, which triggers the breakage when mapping javascript-name over it. I
didn't find out where that entry comes from. This is probably a cljsbuild
issue, so I'll amend the ticket if I have time to look into this within a
few days.

So clojure.browser.repl transitively depends on third_party now
Not only that, there are a lot of files in closure lib proper that depend
on goog.async.Deferred, as you can verify by running

grep -r "goog.require('goog.async.Deferred')" closure/library/closure

from cljs root dir. That begs two questions:
- Are there other third-party libs referred to from closure proper and has
that been the case with older versions?
- Does it still make sense to split closure lib?


2012/11/13 Herwig Hochleitner 

> I've seen this same NPE in my project. I managed to work around it by
> temporarily throwing out the browser repl. It seems to trigger the NPE. Not
> sure how and why.
>
>
> 2012/11/13 Evan Mezeske 
>
>> The policy is: update the default version as quickly as possible when a
>> new ClojureScript compiler revision is released.  So, feel free to poke me
>> if it seems like I haven't noticed a new release (as I might not have!).  :)
>>
>> Unfortunately, after setting the default ClojureScript version to
>> 0.0-1535, the lein-cljsbuild simple project compiles fine, but attempting
>> to compile the advanced project results in a NullPointerException:
>>
>> https://github.com/emezeske/lein-cljsbuild/issues/155
>>
>> This is going to take some debugging -- I'm not comfortable releasing
>> lein-cljsbuild until both example projects compile and run cleanly.  If
>> anyone has insight into the problem, that would be great.
>>
>> -Evan
>>
>> --
>> 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 that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>>
>
>

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: question concerning macros by a newbie

2012-11-13 Thread Johannes


Am Dienstag, 13. November 2012 12:06:10 UTC+1 schrieb Christophe Grand:
>
> (symbol (str ":" (str (first components should be (keyword (first 
> components))
> In your expansion, :x is not a keyword but a symbol starting by a colon -- 
> the symbol fn performs no validation on its input.
> When you copied/pasted it for evaluation it was then read as a keyword.
>
I understand 

>
> Btw I'm a little worried: are you planning to generate accessors for your 
> fields or are you just toying with macros?
>
both, I am learning about macros and I enjoy to build an alternative syntax 
for records; I know that the keywords can be uses as accessors

thanks
Johannes

>
>
> On Tue, Nov 13, 2012 at 11:06 AM, Johannes 
> 
> > wrote:
>
>> Hi,
>>
>> I define a record
>> (defrecord point [x y])
>>
>> and the following macro:
>>
>> (defmacro drg
>>   [typename components]
>>   `(def ~(symbol (str typename "-" (str (first components
>>  (fn [~(symbol "obj")] (get ~(symbol "obj") ~(symbol (str ":" (str 
>> (first components
>>
>> the call 
>> user> (macroexpand-1 '(drg point [x y]))
>>
>> delivers what I expect:
>> (def point-x (clojure.core/fn [obj] (clojure.core/get obj :x)))
>>
>> Evalutating this expression at the repl delivers what I expect:
>> user> (def point-x (clojure.core/fn [obj] (clojure.core/get obj :x)))
>> #'user/point-x
>>
>> But calling the macro results in an error message:
>> user> (drg point [x y])
>> CompilerException java.lang.RuntimeException: Unable to resolve symbol: 
>> :x in this context, compiling:(NO_SOURCE_PATH:1) 
>>
>> Can anyone tell me what my mistake is?
>>
>> Johannes
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>
>
>
>
> -- 
> Professional: http://cgrand.net/ (fr)
> On Clojure: http://clj-me.cgrand.net/ (en)
>  

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: question concerning macros by a newbie

2012-11-13 Thread Johannes


Am Dienstag, 13. November 2012 12:09:39 UTC+1 schrieb Jim foo.bar:
>
> You can't convert to keyword simply by (str ":" (str (first 
> components))...you need the (keyword (first components))

in the meantime I learned this from Christophe 

> ...also why is 
> your argument (symbol "obj")? I'd prefer obj# or (gensym obj)... 
>
I looked for something like that, but didn't find Bitte um Rücksprache!

Johannes 


> On 13/11/12 10:06, Johannes wrote: 
> > Hi, 
> > 
> > I define a record 
> > (defrecord point [x y]) 
> > 
> > and the following macro: 
> > 
> > (defmacro drg 
> >   [typename components] 
> >   `(def ~(symbol (str typename "-" (str (first components 
> >  (fn [~(symbol "obj")] (get ~(symbol "obj") ~(symbol (str ":" (str 
> > (first components 
> > 
> > the call 
> > user> (macroexpand-1 '(drg point [x y])) 
> > 
> > delivers what I expect: 
> > (def point-x (clojure.core/fn [obj] (clojure.core/get obj :x))) 
> > 
> > Evalutating this expression at the repl delivers what I expect: 
> > user> (def point-x (clojure.core/fn [obj] (clojure.core/get obj :x))) 
> > #'user/point-x 
> > 
> > But calling the macro results in an error message: 
> > user> (drg point [x y]) 
> > CompilerException java.lang.RuntimeException: Unable to resolve 
> > symbol: :x in this context, compiling:(NO_SOURCE_PATH:1) 
> > 
> > Can anyone tell me what my mistake is? 
> > 
> > Johannes 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Clojure" group. 
> > To post to this group, send email to clo...@googlegroups.com 
> > Note that posts from new members are moderated - please be patient 
> > with your first post. 
> > To unsubscribe from this group, send email to 
> > clojure+u...@googlegroups.com  
> > For more options, visit this group at 
> > http://groups.google.com/group/clojure?hl=en 
>
>

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: question concerning macros by a newbie

2012-11-13 Thread Johannes


Am Dienstag, 13. November 2012 12:15:17 UTC+1 schrieb thorwil:
>
> On 11/13/2012 11:06 AM, Johannes wrote: 
> > I define a record 
> > (defrecord point [x y]) 
> > 
> > and the following macro: 
> > 
> > (defmacro drg 
> >[typename components] 
> >`(def ~(symbol (str typename "-" (str (first components 
> >   (fn [~(symbol "obj")] (get ~(symbol "obj") ~(symbol (str ":" (str 
> > (first components 
>
> > But calling the macro results in an error message: 
> > user> (drg point [x y]) 
> > CompilerException java.lang.RuntimeException: Unable to resolve symbol: 
> > :x in this context, compiling:(NO_SOURCE_PATH:1) 
> > 
> > Can anyone tell me what my mistake is? 
>
> I guess the problem is that you created :x using symbol, so it is not 
> recognized as a key. 
>
> But the whole approach, starting with creating names to def to inside a 
> macro, is troublesome. This makes it hard to follow what's going on. If 
> you provide a larger context of what you are trying to accomplish, I'm 
> sure someone can suggest a much better approach. 
>
I am trying to build an alternative record building macro. For example

(define-record point [x y])
should define 
- a new type point
- a constructor make-point
- a type checker point?
- and 2 getters point-x and point-y

Johannes

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

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

2012-11-13 Thread Stuart Sierra
My original reason for splitting the third-party JAR was the licensing: the 
main G.Closure library is under the Apache license; the third-party 
libraries are under a variety of different licenses.

One simple solution would be to make ClojureScript itself have a dependency 
on the third-party libs in addition to the core G.Closure libraries. Then 
users would still have the option of excluding the third-party extensions 
from their projects.

-S

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Interactive form workflow with Friend, can't log in

2012-11-13 Thread Thorsten Wilms

On 11/13/2012 12:28 PM, Haim Ashkenazi wrote:

Here's how you wrap your application with middleware (root-routes is
your main routes:

(def app
   (-> #'root-routes
(friend/authenticate …)
(wrap-keyword-params)
(wrap-params)
…))

Now following your example you can
(web/start app)


Thank you! I had something similar already, but my testing got thwarted 
by expecting too much of ring-reload. Now the following does the trick:


(def secured-app
  (-> #'root-routes
  (friend/authenticate {:credential-fn (partial 
creds/bcrypt-credential-fn users)

:workflows [(workflows/interactive-form)]})
  wrap-keyword-params
  wrap-params
  (wrap-session {:store (immutant-session/servlet-store)})))

(web/start secured-app :reload true)


Finding this example helped:
https://github.com/marianoguerra/immutant-recipes/tree/master/friend-acl


--
Thorsten Wilms

thorwil's design for free software:
http://thorwil.wordpress.com/

--
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: question concerning macros by a newbie

2012-11-13 Thread Tassilo Horn
Johannes  writes:

Hi Johannes,

> I am trying to build an alternative record building macro. For example
>
> (define-record point [x y])
> should define 
> - a new type point
> - a constructor make-point

(defrecord Point [x y]) generates also a constructor function (->Point x
y).

> - a type checker point?

As a shorthand for (instance? Point my-obj)?  Well, that could make
sense here and there, although in general, if you use those type-checks
like

 (cond
  (Point? o)   (transform-point o)
  (Polygon? o) (transform-polygon o)
  ...)

it's likely that you want a protocol Transformable declaring a
`transform` method, and both Point and Polygon provide an implementation
for it.  Then the above becomes just (transform o), and it'll do the
right thing no matter if it's a Point or Polygon.

> - and 2 getters point-x and point-y

I don't see a benefit of (point-x point) over (:x point).

The main problem with your `define-point` macro is that it should also
allow for defining protocol implementations like `defrecord`.  Else,
it's simply not as powerful as the latter.

Bye,
Tassilo

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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

2012-11-13 Thread Herwig Hochleitner
I concur, but maybe we could make a second release of the closure lib main
jar, with a dependency on third-party?
That would reflect the actual dependency.

I know, you asked for testing before the release. Sorry for not catching
this one.


2012/11/13 Stuart Sierra 

> My original reason for splitting the third-party JAR was the licensing:
> the main G.Closure library is under the Apache license; the third-party
> libraries are under a variety of different licenses.
>
> One simple solution would be to make ClojureScript itself have a
> dependency on the third-party libs in addition to the core G.Closure
> libraries. Then users would still have the option of excluding the
> third-party extensions from their projects.
>
> -S
>
>
>  --
> 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 that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: First foray into clojure - questions for new project

2012-11-13 Thread Jonathon McKitrick
Thanks, Mark.

So leiningen has made a significant update lately?

>
On Monday, November 12, 2012 8:49:32 PM UTC-5, Mark Rathwell wrote:

>
> These 4 should help you get from zero to a simple web app running on 
> Heroku pretty quickly:
>
> https://github.com/technomancy/leiningen/wiki/Upgrading
>

So leiningen has made a significant update lately?

>
>

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: First foray into clojure - questions for new project

2012-11-13 Thread Jonathon McKitrick
Thanks, Michael.

Should I dive into Ring as well?  What about Compojure versus Noir?

On Monday, November 12, 2012 9:26:25 PM UTC-5, Michael Klishin wrote:
>
> 2012/11/13 Jonathon McKitrick >
>
>> - Any caveats I should be aware of running clojure on heroku?
>>
>
> For small pure Clojure apps, probably none.
>  
>
>> - What libraries should I become familiar with for straightforward web 
>> apps?
>>
>
> Compojure, Noir, clojure.java.jdbc, clojurewerkz.org libraries. See also
> http://clojure-doc.org/articles/ecosystem/libraries_directory.html
>  
>
>> - What tutorials would get me up and running ASAP?  I'm currently an 
>> intermediate SBCL user.
>>
>
> http://clojure-doc.org/articles/tutorials/basic_web_development.html is 
> very new and not very complete
> but sounds like what you are looking for.
>
> -- 
> MK
>
> http://github.com/michaelklishin
> http://twitter.com/michaelklishin
>
>  

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: First foray into clojure - questions for new project

2012-11-13 Thread Jonathon McKitrick
Hmm.  Is this something I could work around, by paying for an extra dino 
during busy periods, then cutting back after the activity passes?

On Tuesday, November 13, 2012 1:50:13 AM UTC-5, puzzler wrote:
>
> Only catch is that the free level of Heroku isn't very useful with 
> Clojure.  The app keeps going to sleep, and the first person to hit your 
> app will have a noticeably lengthy wait because Clojure takes a long time 
> to start up.
>

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Where did the idea of metadata come from?

2012-11-13 Thread Paul deGrandis
Here's one use case:

Let's say you want to develop a library that monitors system behavior and 
resources while functions are executed (or while collections are processed).
You might have a collection of monitoring functions (we'll call them 
sensors) that check various things, like disk I/O activity.

We now need a way to annotate our other functions and collections (maps, 
vectors, etc) with the sensors that concern them.
For example, maybe we want to ensure a given function doesn't run off with 
exponential disk writing (commonly called a 'log explosion') - this defect 
caused one of the Mars Rovers to crash.

One way is to attach the sensors directly to the functions in the form of 
metadata.  You could then run the functions in a special context that 
executed sensors from any piece of metadata.
- - - 

Another example might be that you want to attached additional specification 
information to functions, so you can run some sort of analysis/verification 
against your code
- - -

It's difficult to spot the best time to apply metadata, since we've become 
accustomed to working in languages without support for it.
Anytime you want to convey programmatic meaning about entities themselves, 
metadata is an elegant solution.

I hope this helps a little.
Paul

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: First foray into clojure - questions for new project

2012-11-13 Thread David Powell
cemerick made a screencast of how to get started with Clojure, which
takes you through getting started with the tools, and making a web
app.  It is probably a great place to start:

  http://cemerick.com/2012/05/02/starting-clojure/


For details on the Clojure web stack, I really like this guide:

  http://brehaut.net/blog/2011/ring_introduction


Note that on Clojure the web stack is made up of a bunch of small
libraries.  They are almost all based on ring.  The guide above
describes the common choices.

-- 
Dave

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


[ANN] moderns-cljs tutorial 6

2012-11-13 Thread Giacomo Cosenza
Hi all,
I'm always a little bit afraid in announcing my small results  as a 
clojure/cljurescript newbie to such a smart community of programmers. 

I just published on github my learning efforts in the 6th tutorial on 
clojurescript

https://github.com/magomimmo/modern-cljs

Hope it can help other newbies like me.

Mimmo


-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] moderns-cljs tutorial 6

2012-11-13 Thread Laurent PETIT
Hi Giacomo,

I haven't had the time to read your articles in-depth, but what I've seen
so far seems pretty good, and I'm certain to follow them closely before
finishing my "clojurescript discovery" journey.

Thanks for that !

-- 
Laurent

2012/11/13 Giacomo Cosenza 

> Hi all,
> I'm always a little bit afraid in announcing my small results  as a
> clojure/cljurescript newbie to such a smart community of programmers.
>
> I just published on github my learning efforts in the 6th tutorial on
> clojurescript
>
> https://github.com/magomimmo/modern-cljs
>
> Hope it can help other newbies like me.
>
> Mimmo
>
>
>  --
> 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 that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: First foray into clojure - questions for new project

2012-11-13 Thread John Gabriele

On Tuesday, November 13, 2012 10:26:18 AM UTC-5, Jonathon McKitrick wrote:
>
> Thanks, Mark.
>
> So leiningen has made a significant update lately?
>
>>

Yes, but my understanding is that most folks have already upgraded (or have 
plans to upgrade --- thus the upgrading guide) to lein 2.

I suggest using the latest preview release of lein 2 (which is also what's 
recommended at leiningen.org).

---John

 

> On Monday, November 12, 2012 8:49:32 PM UTC-5, Mark Rathwell wrote:
>
>>
>> These 4 should help you get from zero to a simple web app running on 
>> Heroku pretty quickly:
>>
>> https://github.com/technomancy/leiningen/wiki/Upgrading
>>
>
> So leiningen has made a significant update lately?
>
>>
>>

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: First foray into clojure - questions for new project

2012-11-13 Thread Michael Klishin
2012/11/13 Jonathon McKitrick 

> Should I dive into Ring as well?  What about Compojure versus Noir?


Noir is built on top of Compojure. I guess just use what you like better.

I don't think you will use Ring directly initially. So get familiar with it
as you need to, the API is tiny.

-- 
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: First foray into clojure - questions for new project

2012-11-13 Thread Mark Rathwell
> Should I dive into Ring as well?  What about Compojure versus Noir?

Noir is higher level than Compojure, and usually easier for new people
to jump into, but not always as flexible, functional or composable.


On Tue, Nov 13, 2012 at 10:27 AM, Jonathon McKitrick
 wrote:
>
> Thanks, Michael.
>
> Should I dive into Ring as well?  What about Compojure versus Noir?
>
>
> On Monday, November 12, 2012 9:26:25 PM UTC-5, Michael Klishin wrote:
>>
>> 2012/11/13 Jonathon McKitrick 
>>>
>>> - Any caveats I should be aware of running clojure on heroku?
>>
>>
>> For small pure Clojure apps, probably none.
>>
>>>
>>> - What libraries should I become familiar with for straightforward web apps?
>>
>>
>> Compojure, Noir, clojure.java.jdbc, clojurewerkz.org libraries. See also
>> http://clojure-doc.org/articles/ecosystem/libraries_directory.html
>>
>>>
>>> - What tutorials would get me up and running ASAP?  I'm currently an 
>>> intermediate SBCL user.
>>
>>
>> http://clojure-doc.org/articles/tutorials/basic_web_development.html is very 
>> new and not very complete
>> but sounds like what you are looking for.
>>
>> --
>> MK
>>
>> http://github.com/michaelklishin
>> http://twitter.com/michaelklishin
>>
> --
> 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 that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Can't go to the Conj, I have 2 tickets

2012-11-13 Thread Kyle R. Burton
Please contact me off list if anyone is interested in purchasing either of
them.

I contacted the organizers and they are transferable.

I'm sorry I'm not going to be able to make it.

Best Regards,

Kyle

-- 
Twitter: @kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: First foray into clojure - questions for new project

2012-11-13 Thread kinleyd
It was helpful for me to start from the ground up: Got familiar with ring, 
then compojure, hiccup, noir, etc. Getting familiar a library at a time 
prepared me better for managing the more comprehensive frameworks when it 
came time to customization. FWIW.

On Wednesday, November 14, 2012 12:20:23 AM UTC+6, Mark Rathwell wrote:
>
> > Should I dive into Ring as well?  What about Compojure versus Noir? 
>
> Noir is higher level than Compojure, and usually easier for new people 
> to jump into, but not always as flexible, functional or composable. 
>
>
> On Tue, Nov 13, 2012 at 10:27 AM, Jonathon McKitrick 
> > wrote: 
> > 
> > Thanks, Michael. 
> > 
> > Should I dive into Ring as well?  What about Compojure versus Noir? 
> > 
> > 
> > On Monday, November 12, 2012 9:26:25 PM UTC-5, Michael Klishin wrote: 
> >> 
> >> 2012/11/13 Jonathon McKitrick  
> >>> 
> >>> - Any caveats I should be aware of running clojure on heroku? 
> >> 
> >> 
> >> For small pure Clojure apps, probably none. 
> >> 
> >>> 
> >>> - What libraries should I become familiar with for straightforward web 
> apps? 
> >> 
> >> 
> >> Compojure, Noir, clojure.java.jdbc, clojurewerkz.org libraries. See 
> also 
> >> http://clojure-doc.org/articles/ecosystem/libraries_directory.html 
> >> 
> >>> 
> >>> - What tutorials would get me up and running ASAP?  I'm currently an 
> intermediate SBCL user. 
> >> 
> >> 
> >> http://clojure-doc.org/articles/tutorials/basic_web_development.htmlis 
> >> very new and not very complete 
> >> but sounds like what you are looking for. 
> >> 
> >> -- 
> >> MK 
> >> 
> >> http://github.com/michaelklishin 
> >> http://twitter.com/michaelklishin 
> >> 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Clojure" group. 
> > To post to this group, send email to clo...@googlegroups.com 
> > Note that posts from new members are moderated - please be patient with 
> your first post. 
> > To unsubscribe from this group, send email to 
> > clojure+u...@googlegroups.com  
> > For more options, visit this group at 
> > http://groups.google.com/group/clojure?hl=en 
>

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Where did the idea of metadata come from?

2012-11-13 Thread Raoul Duke
On Tue, Nov 13, 2012 at 7:56 AM, Paul deGrandis
 wrote:
> It's difficult to spot the best time to apply metadata, since we've become
> accustomed to working in languages without support for it.

not exactly, it is just that most java people put all their metadata
in extra xml files :-)

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Where did the idea of metadata come from?

2012-11-13 Thread David Nolen
Macros. Metadata is a perfect way to annotate symbols that need to be
processed in some specific way or to provide extra information when
debugging. Many serious macros I've written use metadata on forms & symbols.

David


On Mon, Nov 12, 2012 at 11:55 PM, Takahiro Hozumi wrote:

> > Metadata is a really useful feature, and it's been helping me a lot.
> Could you show me concrete example?
> I still don't understand the value of metadata and rarely use it
> except type hint.
> I saw active using metadata on some project(e.g. postal[1]), but I
> think regular hashmap instead of metadata is also good enough for the
> purpose.
>
> [1] https://github.com/drewr/postal
>
> Cheers,
> -Takahiro
>
> On Nov 13, 6:01 am, JvJ  wrote:
> > Metadata is a really useful feature, and it's been helping me a lot.  It
> > seems like a flash of genius on the part of Mr. Hickey.  I'm wondering if
> > similar concepts exist in other programming languages that inspired it,
> or
> > if it's unique to Clojure.  Just a matter of curiosity, really.
>
> --
> 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 that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Dynamically building SQL queries with core.match & dynamic variables

2012-11-13 Thread David Jagoe
G'day all,

I am building a reporting interface on top of a database with a star
schema. The star schema makes it very easy to restrict queries by various
combinations of dimension. Some combinations are legal; others are not.
Hence core.match. The number of possible combinations is large, and I would
like to provide a simple API for setting up the dimensional constraints
before running a query.

I have in mind to use dynamic variables because in generating reports, a
few separate queries to the database are required - always with the same
dimensional constraints for a particular instance of a report. It is a pain
to pass a large number of parameters down the call stack - all the way from
the interface to the presentation layer, to the mapping layer which
ultimately builds and runs the query against the db. It would be even more
of a pain to update all calls with new parameters every time I add a new
dimension to the database.

So the interface would look something like this:

(binding [*dimension1* ... *dimension2* ... *dimension3* ...]
(get-fact-1-aggregates mandatory-dimension-restriction)
(get-fact-2-aggs mandatory-dim-rest)
)

Or more concretely if you like a bit of context:

(binding [*drill-name* "DR1" *hole-name* "h1" *from* timestamp *to*
timestamp2]
(do-something-with (drilling-aggregates 123))
(do-something-with (reaming-aggregates 123))
)

Where 123 would be a company ID set by the user's login credentials and
since it is mandatory and will always be passed I have put it as a formal
parameters.

Here is a rough draft of the code I have in mind.

I would very much appreciate any comments as to the sanity of this
approach, and any other ideas on how to do it better.

Specifically - any better ways of building the query??

Note: I have not populated all the legal combinations of variables so the
match would grow.

Thanks!
David


(ns hummingbird.mappers.core
  (:require
   [hummingbird.mappers.database :as db]
   [clojure.java.jdbc :as sql]
   [clojure.core.match :refer [match]]))

(def ^:dynamic *job-name* nil)
(def ^:dynamic *drill-name* nil)
(def ^:dynamic *hole-name* nil)
(def ^:dynamic *from* nil)
(def ^:dynamic *to* nil)

(def !nil? (complement nil?))

(defn build-dr-query
  ([company-name hole-selection from-selection to-selection]
 (format
  "SELECT
round((sum(dr.distance)/sum(dr.sample_period))::numeric, 2) as feed_rate
FROM
drilling as dr,
dim_time as t,
dim_hole as h
WHERE
dr.time_key = t.time_key
AND dr.hole_key = h.hole_key
AND h.company_name = '%s' -- mandatory company restriction
%s -- optional hole restriction
%s -- optional time from restriction
%s -- optional time to restriction
" company-name hole-selection from-selection to-selection))

  ([company-name]

 (match [company-name *hole-name* *from* *to*]

[company-name nil nil nil]
(build-dr-query company-name "" "" "")

[company-name (hole-name :guard !nil?) nil nil]
(build-dr-query company-name
(format "AND h.hole_name = '%s'" hole-name)
""
"")

[company-name (hole-name :guard !nil?) (from :guard !nil?) nil]
(build-dr-query company-name
(format "AND h.hole_name = '%s'" hole-name)
(format "AND t.date >= '%s'::timestamp" from)
"")

[company-name (hole-name :guard !nil?) (from :guard !nil?) (to
:guard !nil?)]
(build-dr-query company-name
(format "AND h.hole_name = '%s'" hole-name)
(format "AND t.date >= '%s'::timestamp" from)
(format "AND t.date  < '%s'::timestamp" to))

:else (throw (Exception. "Illegal combination")

(defn drilling-aggregates [& {:keys [group-by order-by]}]
  (sql/with-connection db/osprey
(sql/with-query-results rows [(build-dr-query "ACME")]
  (db/only-one rows


-- 
David Jagoe

davidja...@gmail.com
+18053284389

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

ANN concerto 0.1.0-SNAPSHOT

2012-11-13 Thread Jamie Brandon
Concerto extends nrepl (and nrepl.el) with a broadcast mechanism so
that multiple users can colloborate within a single repl.

Just an experiment, I'm curious to see whether anyone has a use for
this. My eventual goal is to use it for collaborative ovetone sessions
but for now I have to get back to other work.

https://github.com/jamii/concerto/

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Where did the idea of metadata come from?

2012-11-13 Thread Mimmo Cosenza
I would to the list the :export metadata used in ClojureScript to prevent 
Google Closure Compiler from minifying variable and function names which 
need to be exposed to regular JS code.

Mimmo

On Monday, November 12, 2012 10:01:43 PM UTC+1, JvJ wrote:
>
> Metadata is a really useful feature, and it's been helping me a lot.  It 
> seems like a flash of genius on the part of Mr. Hickey.  I'm wondering if 
> similar concepts exist in other programming languages that inspired it, or 
> if it's unique to Clojure.  Just a matter of curiosity, really.

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: ANN concerto 0.1.0-SNAPSHOT

2012-11-13 Thread Bruce Durling
I know at least one clojure dojo that would be interested.
On Nov 13, 2012 7:24 PM, "Jamie Brandon" 
wrote:

> Concerto extends nrepl (and nrepl.el) with a broadcast mechanism so
> that multiple users can colloborate within a single repl.
>
> Just an experiment, I'm curious to see whether anyone has a use for
> this. My eventual goal is to use it for collaborative ovetone sessions
> but for now I have to get back to other work.
>
> https://github.com/jamii/concerto/
>
> --
> 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 that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] moderns-cljs tutorial 6

2012-11-13 Thread Mimmo Cosenza
Thanks Laurent,
you're right about CLJS, it's a journey, a good one to me. I'm not a 
client-side guy and for the first time I can enjoy programming the browser.

My best

Mimmo
 

On Tuesday, November 13, 2012 5:44:49 PM UTC+1, lpetit wrote:
>
> Hi Giacomo, 
>
> I haven't had the time to read your articles in-depth, but what I've seen 
> so far seems pretty good, and I'm certain to follow them closely before 
> finishing my "clojurescript discovery" journey.
>
> Thanks for that !
>
> -- 
> Laurent
>
> 2012/11/13 Giacomo Cosenza >
>
>> Hi all,
>> I'm always a little bit afraid in announcing my small results  as a 
>> clojure/cljurescript newbie to such a smart community of programmers. 
>>
>> I just published on github my learning efforts in the 6th tutorial on 
>> clojurescript
>>
>> https://github.com/magomimmo/modern-cljs
>>
>> Hope it can help other newbies like me.
>>
>> Mimmo
>>
>>
>>  -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>
>
>

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

code waiting on something - cannot debug - driving me insane!!!

2012-11-13 Thread Jim - FooBar();

Hi all,

I've had this unbelievable problem for some time now but I'm sick and 
tired of ignoring it! It is literally driving nuts...Due to the nature 
of the problem my terminal hangs and Eclipse crashes altogether 
(potentially losing work)!


So what is the problem...Well I really don't have a clue! it is pretty 
obvious that my code is waiting on something but it only happens when 
I've got a dependency on a namespace of mine which uses seesaw. It is 
basically my gui...the bad behaviour is exhibited every time I try to 
reload my namespace after having opened a JFrame regardless of having 
done anything on the frame! I mean the same happens if I open it and 
close it straight after!


anyway, I managed to mock the behaviour with a minimal example:
-

(ns Clondie24.games.dummy
  (:require [Clondie24.lib.gui :as gui]))

(def details {:name 'Dummy
  :players 2
  :arena-size [420 :by 505]
  :tile-size 133})

(defn -main
"Starts a graphical (swing) Chess game."
[& args]
(gui/show-gui! details))


(ns Clondie24.lib.gui
(:require [Clondie24.lib.util :as ut]
  [Clondie24.lib.core :as core]
  [seesaw.core :as ssw]
  [seesaw.chooser :as choo])
(:import  [java.awt AlphaComposite Graphics Graphics2D Toolkit]
  [java.awt.event MouseEvent]
  [javax.swing SwingWorker UIManager]) )

(def curr-game (promise))
(def status-label (ssw/label :id :status :text "Ready!"))

(defn draw-tiles [d ^Graphics g]
  (let [w (ssw/width d)
h (ssw/height d)
tile-size (:tile-size @curr-game)
tiles (map vector (for [x (range 0 w tile-size)
y (range 0 h tile-size)] [x y])
  (cycle (:alternating-colours @curr-game)))]
(when (:alternating-colours @curr-game)
  (doseq [[[x y] c] tiles]
   (.setColor g c)
   (.fillRect g x y tile-size tile-size)) )
 (draw-grid d g)
 (draw-images g)
 (highlight-rects g)))

(def canvas "The paintable canvas - our board"
 (ssw/canvas
:paint draw-tiles
:id :canvas
:listen [:mouse-clicked (fn [e] (when-not (and (:block? @knobs)
 (realized? 
curr-game))

  (canva-react e)))]
))

(defn arena "Constructs and returns the entire arena frame." []
 (ssw/frame
:title "Clondie24 Arena"
:size  (:arena-size @curr-game)
:resizable? false
:on-close :exit
:menubar  nil ;(make-menubar)
:content  (ssw/border-panel
   :border 10
   :hgap 10
   :vgap 10 ;;IGNORE ALL THIS FOLLOWING CODE TO SAVE TIME
   :north  (ssw/horizontal-panel :items
   [(ssw/button :text "Undo"  :listen [:action (fn 
[e] (when-not (:block? @knobs)

(do (refresh :highlighting? false
:hint nil)
(undo!) (ssw/repaint! canvas]) [:fill-h 10]
(ssw/button :text "Clear" :listen [:action (fn 
[e] (when-not (:block? @knobs)

(do (refresh :highlighting? false
:hint nil)
(clear!) (ssw/repaint! canvas]) [:fill-h 10]
(ssw/button :text "Available Moves" :listen 
[:action (fn [e] (when-not (:block? @knobs)
(do 
(refresh :highlighting? true

:hint nil)
(ssw/repaint! canvas]) [:fill-h 10]
(ssw/button :text "Hint" :listen [:action (fn 
[e] (when-not (:block? @knobs)
 (do (knob! 
:highlighting? false)

(with-busy-cursor canvas
  (hint 
(:pref-depth @curr-game)) :hint]) [:fill-h 10]])

   :center canvas
   :south  status-label)))


(defn show-gui! "Everything starts from here." [game-map]
  (deliver curr-game game-map) ;firstly make the gui aware of what game 
we want it to display

   (ssw/invoke-later
 (doto (arena) ssw/show!)))

---

any thoughts / feedback are greatly welcome. I cannot see why such a 
standard setup would hang after trying to reload the dummy namespace. 
everything reloads just fine as long as i don't show anything on 
screen...scary stuff!


thanks in advance...

Jim



--
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: ANN concerto 0.1.0-SNAPSHOT

2012-11-13 Thread Florian Over
Hi Jamie,
will take a look on this. :)
Thursday is our Meetup (Cologne Clojure User Group).


Thanks
Florian

2012/11/13 Bruce Durling :
> I know at least one clojure dojo that would be interested.
>
> On Nov 13, 2012 7:24 PM, "Jamie Brandon" 
> wrote:
>>
>> Concerto extends nrepl (and nrepl.el) with a broadcast mechanism so
>> that multiple users can colloborate within a single repl.
>>
>> Just an experiment, I'm curious to see whether anyone has a use for
>> this. My eventual goal is to use it for collaborative ovetone sessions
>> but for now I have to get back to other work.
>>
>> https://github.com/jamii/concerto/
>>
>> --
>> 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 that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>
> --
> 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 that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: code waiting on something - cannot debug - driving me insane!!!

2012-11-13 Thread Dave Ray
Just a wild guess, but if something's shown on the screen,
#'draw-tiles will probably get invoked to paint the canvas and it
might end up blocking on the #'curr-game promise.

Dave

On Tue, Nov 13, 2012 at 12:19 PM, Jim - FooBar();  wrote:
> Hi all,
>
> I've had this unbelievable problem for some time now but I'm sick and tired
> of ignoring it! It is literally driving nuts...Due to the nature of the
> problem my terminal hangs and Eclipse crashes altogether (potentially losing
> work)!
>
> So what is the problem...Well I really don't have a clue! it is pretty
> obvious that my code is waiting on something but it only happens when I've
> got a dependency on a namespace of mine which uses seesaw. It is basically
> my gui...the bad behaviour is exhibited every time I try to reload my
> namespace after having opened a JFrame regardless of having done anything on
> the frame! I mean the same happens if I open it and close it straight after!
>
> anyway, I managed to mock the behaviour with a minimal example:
> -
>
> (ns Clondie24.games.dummy
>   (:require [Clondie24.lib.gui :as gui]))
>
> (def details {:name 'Dummy
>   :players 2
>   :arena-size [420 :by 505]
>   :tile-size 133})
>
> (defn -main
> "Starts a graphical (swing) Chess game."
> [& args]
> (gui/show-gui! details))
>
>
> (ns Clondie24.lib.gui
> (:require [Clondie24.lib.util :as ut]
>   [Clondie24.lib.core :as core]
>   [seesaw.core :as ssw]
>   [seesaw.chooser :as choo])
> (:import  [java.awt AlphaComposite Graphics Graphics2D Toolkit]
>   [java.awt.event MouseEvent]
>   [javax.swing SwingWorker UIManager]) )
>
> (def curr-game (promise))
> (def status-label (ssw/label :id :status :text "Ready!"))
>
> (defn draw-tiles [d ^Graphics g]
>   (let [w (ssw/width d)
> h (ssw/height d)
> tile-size (:tile-size @curr-game)
> tiles (map vector (for [x (range 0 w tile-size)
> y (range 0 h tile-size)] [x y])
>   (cycle (:alternating-colours @curr-game)))]
> (when (:alternating-colours @curr-game)
>   (doseq [[[x y] c] tiles]
>(.setColor g c)
>(.fillRect g x y tile-size tile-size)) )
>  (draw-grid d g)
>  (draw-images g)
>  (highlight-rects g)))
>
> (def canvas "The paintable canvas - our board"
>  (ssw/canvas
> :paint draw-tiles
> :id :canvas
> :listen [:mouse-clicked (fn [e] (when-not (and (:block? @knobs)
>  (realized? curr-game))
>   (canva-react e)))]
> ))
>
> (defn arena "Constructs and returns the entire arena frame." []
>  (ssw/frame
> :title "Clondie24 Arena"
> :size  (:arena-size @curr-game)
> :resizable? false
> :on-close :exit
> :menubar  nil ;(make-menubar)
> :content  (ssw/border-panel
>:border 10
>:hgap 10
>:vgap 10 ;;IGNORE ALL THIS FOLLOWING CODE TO SAVE TIME
>:north  (ssw/horizontal-panel :items
>[(ssw/button :text "Undo"  :listen [:action (fn [e]
> (when-not (:block? @knobs)
> (do (refresh :highlighting? false
> :hint nil)
> (undo!) (ssw/repaint! canvas]) [:fill-h 10]
> (ssw/button :text "Clear" :listen [:action (fn [e]
> (when-not (:block? @knobs)
> (do (refresh :highlighting? false
> :hint nil)
> (clear!) (ssw/repaint! canvas]) [:fill-h 10]
> (ssw/button :text "Available Moves" :listen [:action
> (fn [e] (when-not (:block? @knobs)
> (do (refresh
> :highlighting? true
> :hint nil)
> (ssw/repaint! canvas]) [:fill-h 10]
> (ssw/button :text "Hint" :listen [:action (fn [e]
> (when-not (:block? @knobs)
>  (do (knob!
> :highlighting? false)
> (with-busy-cursor canvas
>   (hint (:pref-depth
> @curr-game)) :hint]) [:fill-h 10]])
>:center canvas
>:south  status-label)))
>
>
> (defn show-gui! "Everything starts from here." [game-map]
>   (deliver curr-game game-map) ;firstly make the gui aware of what game we
> want it to display
>(ssw/invoke-later
>  (doto (arena) ssw/show!)))
>
> ---
>
> any thoughts / feedback are greatly welcome. I cannot see why such a
> standard setup would hang after trying to reload the dummy namespace.
> everything reloads just fine as long as i don't show anything on
> screen...scary stuff!
>
> thanks in advance...
>
> Jim
>
>
>
> --
> You received this message because you are subscribed

Re: ANN concerto 0.1.0-SNAPSHOT

2012-11-13 Thread Chas Emerick
Bravo.  I suspect there's lots of fertile ground for supporting alternative 
topologies using custom middlewares and transports.  Carry on. :-)

- Chas

On Nov 13, 2012, at 2:24 PM, Jamie Brandon wrote:

> Concerto extends nrepl (and nrepl.el) with a broadcast mechanism so
> that multiple users can colloborate within a single repl.
> 
> Just an experiment, I'm curious to see whether anyone has a use for
> this. My eventual goal is to use it for collaborative ovetone sessions
> but for now I have to get back to other work.
> 
> https://github.com/jamii/concerto/
> 
> -- 
> 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 that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: code waiting on something - cannot debug - driving me insane!!!

2012-11-13 Thread Laurent PETIT
Hello,

As of the freeze of Eclipse: you're probably using 0.10.1. A problem
of hangs in relation with the way Counterclockwise was talking to the
repl has been fixed in the beta. You could either switch right now to
the beta "channel" ( http://ccw.crand.net/updatesite-betas/ ) either
wait until Thursday, I'll deliver what is currently in beta into a new
stable release (0.10.2)

Sent from a smartphone, please excuse the brevity/typos.

Le 13 nov. 2012 à 21:19, "Jim - FooBar();"  a écrit :

> Hi all,
>
> I've had this unbelievable problem for some time now but I'm sick and tired 
> of ignoring it! It is literally driving nuts...Due to the nature of the 
> problem my terminal hangs and Eclipse crashes altogether (potentially losing 
> work)!
>
> So what is the problem...Well I really don't have a clue! it is pretty 
> obvious that my code is waiting on something but it only happens when I've 
> got a dependency on a namespace of mine which uses seesaw. It is basically my 
> gui...the bad behaviour is exhibited every time I try to reload my namespace 
> after having opened a JFrame regardless of having done anything on the frame! 
> I mean the same happens if I open it and close it straight after!
>
> anyway, I managed to mock the behaviour with a minimal example:
> -
>
> (ns Clondie24.games.dummy
>  (:require [Clondie24.lib.gui :as gui]))
>
> (def details {:name 'Dummy
>  :players 2
>  :arena-size [420 :by 505]
>  :tile-size 133})
>
> (defn -main
> "Starts a graphical (swing) Chess game."
> [& args]
> (gui/show-gui! details))
>
>
> (ns Clondie24.lib.gui
>(:require [Clondie24.lib.util :as ut]
>  [Clondie24.lib.core :as core]
>  [seesaw.core :as ssw]
>  [seesaw.chooser :as choo])
>(:import  [java.awt AlphaComposite Graphics Graphics2D Toolkit]
>  [java.awt.event MouseEvent]
>  [javax.swing SwingWorker UIManager]) )
>
> (def curr-game (promise))
> (def status-label (ssw/label :id :status :text "Ready!"))
>
> (defn draw-tiles [d ^Graphics g]
>  (let [w (ssw/width d)
>h (ssw/height d)
>tile-size (:tile-size @curr-game)
>tiles (map vector (for [x (range 0 w tile-size)
>y (range 0 h tile-size)] [x y])
>  (cycle (:alternating-colours @curr-game)))]
> (when (:alternating-colours @curr-game)
>  (doseq [[[x y] c] tiles]
>   (.setColor g c)
>   (.fillRect g x y tile-size tile-size)) )
> (draw-grid d g)
> (draw-images g)
> (highlight-rects g)))
>
> (def canvas "The paintable canvas - our board"
> (ssw/canvas
>:paint draw-tiles
>:id :canvas
>:listen [:mouse-clicked (fn [e] (when-not (and (:block? @knobs)
> (realized? curr-game))
>  (canva-react e)))]
>))
>
> (defn arena "Constructs and returns the entire arena frame." []
> (ssw/frame
>:title "Clondie24 Arena"
>:size  (:arena-size @curr-game)
>:resizable? false
>:on-close :exit
>:menubar  nil ;(make-menubar)
>:content  (ssw/border-panel
>   :border 10
>   :hgap 10
>   :vgap 10 ;;IGNORE ALL THIS FOLLOWING CODE TO SAVE TIME
>   :north  (ssw/horizontal-panel :items
>   [(ssw/button :text "Undo"  :listen [:action (fn [e] 
> (when-not (:block? @knobs)
> (do (refresh :highlighting? false
> :hint nil)
> (undo!) (ssw/repaint! canvas]) [:fill-h 10]
>(ssw/button :text "Clear" :listen [:action (fn [e] 
> (when-not (:block? @knobs)
> (do (refresh :highlighting? false
> :hint nil)
> (clear!) (ssw/repaint! canvas]) [:fill-h 10]
>(ssw/button :text "Available Moves" :listen [:action 
> (fn [e] (when-not (:block? @knobs)
>(do (refresh 
> :highlighting? true
> :hint nil)
> (ssw/repaint! canvas]) [:fill-h 10]
>(ssw/button :text "Hint" :listen [:action (fn [e] 
> (when-not (:block? @knobs)
> (do (knob! :highlighting? 
> false)
> (with-busy-cursor canvas
>  (hint (:pref-depth 
> @curr-game)) :hint]) [:fill-h 10]])
>   :center canvas
>   :south  status-label)))
>
>
> (defn show-gui! "Everything starts from here." [game-map]
>  (deliver curr-game game-map) ;firstly make the gui aware of what game we 
> want it to display
>   (ssw/invoke-later
> (doto (arena) ssw/show!)))
>
> ---
>
> any thoughts / feedback are greatly welcome. I cannot see why such a standard 
> setup would hang after trying t

Re: code waiting on something - cannot debug - driving me insane!!!

2012-11-13 Thread Jim - FooBar();

On 13/11/12 20:36, Dave Ray wrote:

Just a wild guess, but if something's shown on the screen,
#'draw-tiles will probably get invoked to paint the canvas and it
might end up blocking on the #'curr-game promise.

thanks for your response Dave,

even though I'm not entirely sure what you mean, I can confirm that the 
promise is not to blame...I replaced it with an atom and the same thing 
happened...Delivering the promise is the very 1st thing happening so I 
can't see how it might be blocking...also, the canvas does not react 
unless the promise has been realized. After closing the gui I can't do 
anything on the dummy namespace...it hangs indefinately...


any other thoughts? I am quite desperate here...

Jim

ps: thanks Laurent, I'll check out the stable release on Thursday. The 
problem is that I'm not getting any exceptions so I'm not sure to much 
extent  the eclipse debugger can help me.


--
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: code waiting on something - cannot debug - driving me insane!!!

2012-11-13 Thread Dave Ray
Dump the JVM's threads [1] and see what it's stuck on?

Dave

[1] http://www.crazysquirrel.com/computing/java/basics/java-thread-dump.jspx

On Tue, Nov 13, 2012 at 1:42 PM, Jim - FooBar();  wrote:
> On 13/11/12 20:36, Dave Ray wrote:
>>
>> Just a wild guess, but if something's shown on the screen,
>> #'draw-tiles will probably get invoked to paint the canvas and it
>> might end up blocking on the #'curr-game promise.
>
> thanks for your response Dave,
>
> even though I'm not entirely sure what you mean, I can confirm that the
> promise is not to blame...I replaced it with an atom and the same thing
> happened...Delivering the promise is the very 1st thing happening so I can't
> see how it might be blocking...also, the canvas does not react unless the
> promise has been realized. After closing the gui I can't do anything on the
> dummy namespace...it hangs indefinately...
>
> any other thoughts? I am quite desperate here...
>
> Jim
>
> ps: thanks Laurent, I'll check out the stable release on Thursday. The
> problem is that I'm not getting any exceptions so I'm not sure to much
> extent  the eclipse debugger can help me.
>
> --
> 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 that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: code waiting on something - cannot debug - driving me insane!!!

2012-11-13 Thread Jim - FooBar();

On 13/11/12 21:45, Dave Ray wrote:

Dump the JVM's threads [1] and see what it's stuck on?


What am I looking for? I don't see anything related with my project...IT 
is pretty obvious from the output though that everything is waiting! No 
clue what though...


Jim
-

2012-11-13 21:47:16
Full thread dump Java HotSpot(TM) 64-Bit Server VM (23.2-b09 mixed mode):

"Thread-11" prio=10 tid=0x7f4268022800 nid=0x1fc8 waiting on 
condition [0x7f4258338000]

   java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for  <0xc286d270> (a 
java.util.concurrent.SynchronousQueue$TransferStack)
at 
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
at 
java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
at 
java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:359)
at 
java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:942)
at 
clojure.tools.nrepl.transport$fn_transport$fn__1008.invoke(transport.clj:41)

at clojure.tools.nrepl.transport.FnTransport.recv(transport.clj:28)
at reply.eval_modes.nrepl$main$fn__1451.invoke(nrepl.clj:154)
at clojure.lang.AFn.run(AFn.java:24)
at java.lang.Thread.run(Thread.java:722)

"NonBlockingInputStreamThread" daemon prio=10 tid=0x7f42685d9000 
nid=0x1fc5 in Object.wait() [0x7f4258439000]

   java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0xc286b100> (a 
jline.internal.NonBlockingInputStream)
at 
jline.internal.NonBlockingInputStream.run(NonBlockingInputStream.java:278)

- locked <0xc286b100> (a jline.internal.NonBlockingInputStream)
at java.lang.Thread.run(Thread.java:722)

"process reaper" daemon prio=10 tid=0x7f42685d5000 nid=0x1fbf 
waiting on condition [0x7f4258461000]

   java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for  <0xc286d7e8> (a 
java.util.concurrent.SynchronousQueue$TransferStack)
at 
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
at 
java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
at 
java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:359)
at 
java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:942)
at 
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

at java.lang.Thread.run(Thread.java:722)

"clojure-agent-send-off-pool-3" prio=10 tid=0x7f4214005000 
nid=0x1fbd runnable [0x7f425856]

   java.lang.Thread.State: RUNNABLE
at java.net.PlainSocketImpl.socketAccept(Native Method)
at 
java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)

at java.net.ServerSocket.implAccept(ServerSocket.java:522)
at java.net.ServerSocket.accept(ServerSocket.java:490)
at clojure.tools.nrepl.server$accept_connection.invoke(server.clj:32)
at clojure.core$binding_conveyor_fn$fn__3989.invoke(core.clj:1822)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.lang.Agent$Action.doRun(Agent.java:116)
at clojure.lang.Agent$Action.run(Agent.java:165)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

at java.lang.Thread.run(Thread.java:722)

"clojure-agent-send-off-pool-2" prio=10 tid=0x7f4214003800 
nid=0x1fbb waiting on condition [0x7f4258663000]

   java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for  <0xc286e000> (a 
java.util.concurrent.SynchronousQueue$TransferStack)
at 
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
at 
java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
at 
java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:359)
at 
java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:942)
at 
clojure.tools.nrepl.transport$fn_transport$fn__1008.invoke(transport.clj:41)

at clojure.tools.nrepl.transport.FnTransport.recv(transport.clj:28)
at clojure.tools.nrepl.transport.FnTransport.recv(transport.clj:27)
at clojure.tools.nrepl.server$handle.invoke(server.clj:24)
at 
clojure.tools.nrepl.server$accept_connection$fn__1256.invoke(server.clj:35)

at clojure.core$binding_c

Re: code waiting on something - cannot debug - driving me insane!!!

2012-11-13 Thread Laurent PETIT
Could you create a small lein2 project on github with what you
previously pasted in this thread correctly spread over files, etc., so
that it's really quick to reproduce the error?

Thanks,

Laurent

Sent from a smartphone, please excuse the brevity/typos.

Le 13 nov. 2012 à 22:52, "Jim - FooBar();"  a écrit :

> On 13/11/12 21:45, Dave Ray wrote:
>> Dump the JVM's threads [1] and see what it's stuck on?
>
> What am I looking for? I don't see anything related with my project...IT is 
> pretty obvious from the output though that everything is waiting! No clue 
> what though...
>
> Jim
> -
>
> 2012-11-13 21:47:16
> Full thread dump Java HotSpot(TM) 64-Bit Server VM (23.2-b09 mixed mode):
>
> "Thread-11" prio=10 tid=0x7f4268022800 nid=0x1fc8 waiting on condition 
> [0x7f4258338000]
>   java.lang.Thread.State: TIMED_WAITING (parking)
>at sun.misc.Unsafe.park(Native Method)
>- parking to wait for  <0xc286d270> (a 
> java.util.concurrent.SynchronousQueue$TransferStack)
>at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
>at 
> java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
>at 
> java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:359)
>at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:942)
>at 
> clojure.tools.nrepl.transport$fn_transport$fn__1008.invoke(transport.clj:41)
>at clojure.tools.nrepl.transport.FnTransport.recv(transport.clj:28)
>at reply.eval_modes.nrepl$main$fn__1451.invoke(nrepl.clj:154)
>at clojure.lang.AFn.run(AFn.java:24)
>at java.lang.Thread.run(Thread.java:722)
>
> "NonBlockingInputStreamThread" daemon prio=10 tid=0x7f42685d9000 
> nid=0x1fc5 in Object.wait() [0x7f4258439000]
>   java.lang.Thread.State: WAITING (on object monitor)
>at java.lang.Object.wait(Native Method)
>- waiting on <0xc286b100> (a jline.internal.NonBlockingInputStream)
>at 
> jline.internal.NonBlockingInputStream.run(NonBlockingInputStream.java:278)
>- locked <0xc286b100> (a jline.internal.NonBlockingInputStream)
>at java.lang.Thread.run(Thread.java:722)
>
> "process reaper" daemon prio=10 tid=0x7f42685d5000 nid=0x1fbf waiting on 
> condition [0x7f4258461000]
>   java.lang.Thread.State: TIMED_WAITING (parking)
>at sun.misc.Unsafe.park(Native Method)
>- parking to wait for  <0xc286d7e8> (a 
> java.util.concurrent.SynchronousQueue$TransferStack)
>at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
>at 
> java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
>at 
> java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:359)
>at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:942)
>at 
> java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043)
>at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103)
>at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>at java.lang.Thread.run(Thread.java:722)
>
> "clojure-agent-send-off-pool-3" prio=10 tid=0x7f4214005000 nid=0x1fbd 
> runnable [0x7f425856]
>   java.lang.Thread.State: RUNNABLE
>at java.net.PlainSocketImpl.socketAccept(Native Method)
>at 
> java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
>at java.net.ServerSocket.implAccept(ServerSocket.java:522)
>at java.net.ServerSocket.accept(ServerSocket.java:490)
>at clojure.tools.nrepl.server$accept_connection.invoke(server.clj:32)
>at clojure.core$binding_conveyor_fn$fn__3989.invoke(core.clj:1822)
>at clojure.lang.AFn.applyToHelper(AFn.java:161)
>at clojure.lang.RestFn.applyTo(RestFn.java:132)
>at clojure.lang.Agent$Action.doRun(Agent.java:116)
>at clojure.lang.Agent$Action.run(Agent.java:165)
>at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>at java.lang.Thread.run(Thread.java:722)
>
> "clojure-agent-send-off-pool-2" prio=10 tid=0x7f4214003800 nid=0x1fbb 
> waiting on condition [0x7f4258663000]
>   java.lang.Thread.State: TIMED_WAITING (parking)
>at sun.misc.Unsafe.park(Native Method)
>- parking to wait for  <0xc286e000> (a 
> java.util.concurrent.SynchronousQueue$TransferStack)
>at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
>at 
> java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
>at 
> java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:359)
>at java.util.concurrent.SynchronousQueue.poll(Synchronous

ANN: Spyscope 0.1.2

2012-11-13 Thread David Greenberg
Spyscope is a library that allows you to write very little code to get
threadsafe tracing of your Clojure.

Example: (println #spy/d (+ 1 2 3)) traces the execution of the form '(+ 1
2 3)

Spyscope also supports interactive querying of trace results with a repl
toolkit (see README)

This version of spyscope has a few new features:
- Spyscope now handles mutable objects correctly!
- The README includes directions on enabling Spyscope in every project with
some Leiningen profile settings.
- Herwig Hochleitner has become the first contributor :)


To use, just include [spyscope "0.1.2"] in your project.clj (or follow the
directions in the README to enable globally). You'll need to (require
'spyscope.core) somewhere if you don't add it as an injection.

See https://github.com/dgrnbrg/spyscope for details. Pull requests welcome!

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: code waiting on something - cannot debug - driving me insane!!!

2012-11-13 Thread Jim - FooBar();
The original project is already on github...I just committed the dummy 
namespace as well so you can have a look...

so, do:

git clone https://github.com/jimpil/Clondie24.git
cd Clondie24
lein2 repl

(load-file "Clondie24.games.dummy.clj")
(ns Clondie24.games.dummy)
(-main)

then close the frame without doing anything and try evaluating anything 
(e.g "(:name details)").
it goes without saying that the same thing happens in all other proper 
games as well...


thanks a million for looking into this :-)

Jim


On 13/11/12 22:35, Laurent PETIT wrote:

Could you create a small lein2 project on github with what you
previously pasted in this thread correctly spread over files, etc., so
that it's really quick to reproduce the error?

Thanks,

Laurent

Sent from a smartphone, please excuse the brevity/typos.

Le 13 nov. 2012 ą 22:52, "Jim - FooBar();"  a écrit :


On 13/11/12 21:45, Dave Ray wrote:

Dump the JVM's threads [1] and see what it's stuck on?

What am I looking for? I don't see anything related with my project...IT is 
pretty obvious from the output though that everything is waiting! No clue what 
though...

Jim
-

2012-11-13 21:47:16
Full thread dump Java HotSpot(TM) 64-Bit Server VM (23.2-b09 mixed mode):

"Thread-11" prio=10 tid=0x7f4268022800 nid=0x1fc8 waiting on condition 
[0x7f4258338000]
   java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for  <0xc286d270> (a 
java.util.concurrent.SynchronousQueue$TransferStack)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
at 
java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
at 
java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:359)
at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:942)
at 
clojure.tools.nrepl.transport$fn_transport$fn__1008.invoke(transport.clj:41)
at clojure.tools.nrepl.transport.FnTransport.recv(transport.clj:28)
at reply.eval_modes.nrepl$main$fn__1451.invoke(nrepl.clj:154)
at clojure.lang.AFn.run(AFn.java:24)
at java.lang.Thread.run(Thread.java:722)

"NonBlockingInputStreamThread" daemon prio=10 tid=0x7f42685d9000 nid=0x1fc5 
in Object.wait() [0x7f4258439000]
   java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0xc286b100> (a jline.internal.NonBlockingInputStream)
at 
jline.internal.NonBlockingInputStream.run(NonBlockingInputStream.java:278)
- locked <0xc286b100> (a jline.internal.NonBlockingInputStream)
at java.lang.Thread.run(Thread.java:722)

"process reaper" daemon prio=10 tid=0x7f42685d5000 nid=0x1fbf waiting on 
condition [0x7f4258461000]
   java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for  <0xc286d7e8> (a 
java.util.concurrent.SynchronousQueue$TransferStack)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
at 
java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
at 
java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:359)
at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:942)
at 
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

"clojure-agent-send-off-pool-3" prio=10 tid=0x7f4214005000 nid=0x1fbd 
runnable [0x7f425856]
   java.lang.Thread.State: RUNNABLE
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
at java.net.ServerSocket.implAccept(ServerSocket.java:522)
at java.net.ServerSocket.accept(ServerSocket.java:490)
at clojure.tools.nrepl.server$accept_connection.invoke(server.clj:32)
at clojure.core$binding_conveyor_fn$fn__3989.invoke(core.clj:1822)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.lang.Agent$Action.doRun(Agent.java:116)
at clojure.lang.Agent$Action.run(Agent.java:165)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

"clojure-agent-send-off-pool-2" prio=10 tid=0x7f4214003800 nid=0x1fbb 
waiting on condition [0x7f4258663000]
   java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking

lein 2.x not working on Mac OS X 10.7.5 -- Exception in thread "main" java.lang.ClassNotFoundException:

2012-11-13 Thread Alec Ramsay
When I do "lein run" now, I get "Exception in thread "main" 
java.lang.ClassNotFoundException:".

I'm early in the process of getting a Clojure development environment set 
up--I coded a lot of LISP years ago and want to dust off my skills with 
Clojure--and I have previously successfully done the following on Mac OS X 
10.7.5:

   - Installed Leiningen using Brew--this installed a V1 version
   - Created and run projects ("lein new"; "lein run"; etc.)
   - Everything worked great

However, I wanted to use nREPL in Aquamacs, so I needed lein 2.x. The only 
way I could get lein2 installed was using these 
steps. 
After completing them, I successfully tested nREPL inside Aquamacs. Again 
things seemed to work great.

But while "lein new" still works, "lein run" does not. I get the following 
exception:

Exception in thread "main" java.lang.ClassNotFoundException: 
http_hello3.core
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at clojure.lang.RT.classForName(RT.java:2039)
at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:207)
at user$eval12.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:6511)
at clojure.lang.Compiler.eval(Compiler.java:6501)
at clojure.lang.Compiler.eval(Compiler.java:6477)
at clojure.core$eval.invoke(core.clj:2797)
at clojure.main$eval_opt.invoke(main.clj:297)
at clojure.main$initialize.invoke(main.clj:316)
at clojure.main$null_opt.invoke(main.clj:349)
at clojure.main$main.doInvoke(main.clj:427)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:419)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.main.main(main.java:37)

My project.clj looks like this:

(defproject http_hello3 "0.1.0-SNAPSHOT"
  :description "http hello"
;  :url "http://example.com/FIXME";
;  :license {:name "Eclipse Public License"
;:url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.4.0"]])

I've done a lot of searching and tried several different things, to no 
avail. I'd appreciate any pointers you can give me. Thanks ...

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: lein 2.x not working on Mac OS X 10.7.5 -- Exception in thread "main" java.lang.ClassNotFoundException:

2012-11-13 Thread Marek Šrank
I also had the same issue some time ago and it was caused by incorrect 
using of dash ('-') vs. underscore ('_') in project/namespace name... I 
don't remember what concretely was wrong, but you at least can try all 
possibilities

Also, are you using gen-class ?

Marek.

On Wednesday, November 14, 2012 1:11:58 AM UTC+1, Alec Ramsay wrote:
>
> When I do "lein run" now, I get "Exception in thread "main" 
> java.lang.ClassNotFoundException:".
>
> I'm early in the process of getting a Clojure development environment set 
> up--I coded a lot of LISP years ago and want to dust off my skills with 
> Clojure--and I have previously successfully done the following on Mac OS X 
> 10.7.5:
>
>- Installed Leiningen using Brew--this installed a V1 version
>- Created and run projects ("lein new"; "lein run"; etc.)
>- Everything worked great
>
> However, I wanted to use nREPL in Aquamacs, so I needed lein 2.x. The only 
> way I could get lein2 installed was using these 
> steps. 
> After completing them, I successfully tested nREPL inside Aquamacs. Again 
> things seemed to work great.
>
> But while "lein new" still works, "lein run" does not. I get the following 
> exception:
>
> Exception in thread "main" java.lang.ClassNotFoundException: 
> http_hello3.core
> at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
> at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:61)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:247)
> at clojure.lang.RT.classForName(RT.java:2039)
> at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:199)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
> at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:207)
> at user$eval12.invoke(NO_SOURCE_FILE:1)
> at clojure.lang.Compiler.eval(Compiler.java:6511)
> at clojure.lang.Compiler.eval(Compiler.java:6501)
> at clojure.lang.Compiler.eval(Compiler.java:6477)
> at clojure.core$eval.invoke(core.clj:2797)
> at clojure.main$eval_opt.invoke(main.clj:297)
> at clojure.main$initialize.invoke(main.clj:316)
> at clojure.main$null_opt.invoke(main.clj:349)
> at clojure.main$main.doInvoke(main.clj:427)
> at clojure.lang.RestFn.invoke(RestFn.java:421)
> at clojure.lang.Var.invoke(Var.java:419)
> at clojure.lang.AFn.applyToHelper(AFn.java:163)
> at clojure.lang.Var.applyTo(Var.java:532)
> at clojure.main.main(main.java:37)
>
> My project.clj looks like this:
>
> (defproject http_hello3 "0.1.0-SNAPSHOT"
>   :description "http hello"
> ;  :url "http://example.com/FIXME";
> ;  :license {:name "Eclipse Public License"
> ;:url "http://www.eclipse.org/legal/epl-v10.html"}
>   :dependencies [[org.clojure/clojure "1.4.0"]])
>
> I've done a lot of searching and tried several different things, to no 
> avail. I'd appreciate any pointers you can give me. Thanks ...
>
>

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Change var in other namespace

2012-11-13 Thread himangshu
this reply was god sent to me. I use tomcat and war to deploy my clojure 
code. the default thing was just not compiling. Although I do not have 
slf4j in my classpath. find logger was still giving slf4j and when it 
encountered first logging statement, the code used to crap out saying class 
not found exception

On Saturday, 19 November 2011 06:17:13 UTC+5:30, Sean Corfield wrote:
>
> On Fri, Nov 18, 2011 at 6:35 AM, vitalyper > 
> wrote:
> > IMO, clojure.tools.logging could of made this easier: log
> > implementation from classpath by default with override by client when
> > needed.
>
> I agree but when I brought the issue up, there didn't seem to be much
> support for making it easier... Perhaps a ticket in JIRA might garner
> some votes?
> -- 
> Sean A Corfield -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
> World Singles, LLC. -- http://worldsingles.com/
>
> "Perfection is the enemy of the good."
> -- Gustave Flaubert, French realist novelist (1821-1880)
>
>

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: lein 2.x not working on Mac OS X 10.7.5 -- Exception in thread "main" java.lang.ClassNotFoundException:

2012-11-13 Thread Herwig Hochleitner
Am 14.11.2012 01:30 schrieb "Marek Šrank" :
>
> I also had the same issue some time ago and it was caused by incorrect
using of dash ('-') vs. underscore ('_') in project/namespace name... I
don't remember what concretely was wrong, but you at least can try all
possibilities

That might well be it. An underscore in the file name should always
correspond to a dash in the namespace name.

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: lein 2.x not working on Mac OS X 10.7.5 -- Exception in thread "main" java.lang.ClassNotFoundException:

2012-11-13 Thread Sean Corfield
On Tue, Nov 13, 2012 at 4:11 PM, Alec Ramsay  wrote:
> But while "lein new" still works, "lein run" does not. I get the following
> exception:

How did you create that project? lein new http_hello3 - or - lein new
http-hello3?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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

2012-11-13 Thread Evan Mezeske
I agree with Herwig, in that if the ClojureScript JAR makes use of 
goog.async.Deferred, which is from the third party library, then the JAR 
really needs to depend on the third-party library.

I doubt that lein-cljsbuild is the only thing broken by this -- I expect 
this would break things like piggieback as well (really, anything that 
depends on ClojureScript but lacks an explicit dependency on the 
third-party stuff).

I could hack a third-party dependency into lein-cljsbuild, but I would 
prefer to just wait until a new ClojureScript is released that addresses 
this issue.

-Evan

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

run-jetty doesn't shut down the server after ctrl+c?

2012-11-13 Thread Satoru Logic
Hi, all.

I am playing with the `ring` library in `repl`. 

After using `run-jetty` to start a server,
I typed `ctrl+c` to send the SIGINT signal,
this ended the `run-jetty` function, but it didn't kill the server:

user=> (require '[ring.adapter.jetty :refer [run-jetty]])
user=> (require '[ring.util.response :refer [response]])
user=> (*run-jetty* (fn [request] (response "Hello world")) {:port 3000})
2012-11-14 11:44:01.892:INFO:oejs.Server:jetty-7.6.1.v20120215
2012-11-14 11:44:01.956:INFO:oejs.AbstractConnector:Started 
SelectChannelConnector@0.0.0.0:3000
^C
user=> (*run-jetty* (fn [request] (response "Save the world")) {:port 
3000}) ; now try to run it again
2012-11-14 11:44:21.358:INFO:oejs.Server:jetty-7.6.1.v20120215
BindException Address already in use  sun.nio.ch.Net.bind (Net.java:-2)

user=> 2012-11-14 11:44:21.370:WARN:oejuc.AbstractLifeCycle:FAILED 
SelectChannelConnector@0.0.0.0:3000: java.net.BindException: Address 
already in use
java.net.BindException: Address already in use


And I can still access the "Hello World" example with "localhost:3000".

Is this a bug?

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: run-jetty doesn't shut down the server after ctrl+c?

2012-11-13 Thread Sean Corfield
On Tue, Nov 13, 2012 at 8:33 PM, Satoru Logic  wrote:
> BindException Address already in use  sun.nio.ch.Net.bind (Net.java:-2)
>
> user=> 2012-11-14 11:44:21.370:WARN:oejuc.AbstractLifeCycle:FAILED
> SelectChannelConnector@0.0.0.0:3000: java.net.BindException: Address already
> in use
> java.net.BindException: Address already in use
>
>
> And I can still access the "Hello World" example with "localhost:3000".

Sounds like you already have a copy of the app - or another ring app -
running since the port is in use and you can still access it.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: run-jetty doesn't shut down the server after ctrl+c?

2012-11-13 Thread Satoru Logic


On Wednesday, November 14, 2012 12:38:55 PM UTC+8, Sean Corfield wrote:
>
> On Tue, Nov 13, 2012 at 8:33 PM, Satoru Logic 
> > 
> wrote: 
> > BindException Address already in use  sun.nio.ch.Net.bind (Net.java:-2) 
> > 
> > user=> 2012-11-14 11:44:21.370:WARN:oejuc.AbstractLifeCycle:FAILED 
> > SelectChannelConnector@0.0.0.0:3000: java.net.BindException: Address 
> already 
> > in use 
> > java.net.BindException: Address already in use 
> > 
> > 
> > And I can still access the "Hello World" example with "localhost:3000". 
>
> Sounds like you already have a copy of the app - or another ring app - 


I used `ctrl+c` to close the first `run-jetty` before running the second 
one.
Maybe I'm doing it the wrong way?
 

> running since the port is in use and you can still access it. 
> -- 
> Sean A Corfield -- (904) 302-SEAN 
> An Architect's View -- http://corfield.org/ 
> World Singles, LLC. -- http://worldsingles.com/ 
>
> "Perfection is the enemy of the good." 
> -- Gustave Flaubert, French realist novelist (1821-1880) 
>

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Are there projects similar to meteor.js and derby.js but for clojure/clojurescript?

2012-11-13 Thread Leon Talbot
These two JS projects are bluring the boundaries between server and client. 

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: run-jetty doesn't shut down the server after ctrl+c?

2012-11-13 Thread Satoru Logic
I've found a related question on StackOverflow.

  
 
http://stackoverflow.com/questions/2706044/how-do-i-stop-jetty-server-in-clojure#2706239

What I have to do is invoking `stop` on the `server` object returned by 
`run-jetty`.

On Wednesday, November 14, 2012 12:38:55 PM UTC+8, Sean Corfield wrote:
>
> On Tue, Nov 13, 2012 at 8:33 PM, Satoru Logic 
> > 
> wrote: 
> > BindException Address already in use  sun.nio.ch.Net.bind (Net.java:-2) 
> > 
> > user=> 2012-11-14 11:44:21.370:WARN:oejuc.AbstractLifeCycle:FAILED 
> > SelectChannelConnector@0.0.0.0:3000: java.net.BindException: Address 
> already 
> > in use 
> > java.net.BindException: Address already in use 
> > 
> > 
> > And I can still access the "Hello World" example with "localhost:3000". 
>
> Sounds like you already have a copy of the app - or another ring app - 
> running since the port is in use and you can still access it. 
> -- 
> Sean A Corfield -- (904) 302-SEAN 
> An Architect's View -- http://corfield.org/ 
> World Singles, LLC. -- http://worldsingles.com/ 
>
> "Perfection is the enemy of the good." 
> -- Gustave Flaubert, French realist novelist (1821-1880) 
>

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

core.match - how to simplify patterns with repeated guards

2012-11-13 Thread David Jagoe
Hi all,

I have a core.match pattern that looks something like this:

(def !nil? (complement nil?))

(match [*a* *b*]
[(a :guard !nil?) nil] (dosomething a)
[nil (b :guard !nil?)] (dosomething b)
[(a :guard !nil?) (b :guard !nil?)] (dosomething a b)
:else (throw (Exception. "Not allowed"))

The point is that in every case I guard the variable using !nil?

I would like to shorten my code:

(match [*a* *b*]
[(!nil a) nil] (dosomething a)
[nil (!nil b)] (dosomething b)
[(!nil a) (!nil b) (dosomething a b)
:else (throw (Exception. "Not allowed"))

But I can't figure out how to write the !nil macro.

I've tried:

(defmacro notnil [sym]
`(~sym :guard (complement nil?)))

Which looks right in expansion:

(macroexpand-1 '(!nil foo))
-> (foo :guard (clojure.core/complement clojure.core/nil?))

But I cannot use this in a match:

(let [foo nil bar 2]
(match [foo bar]
   [(!nil foo) 2] foo
   :else :notfound))
CompilerException java.lang.AssertionError: Invalid list syntax foo in
(!nil foo)

Why!!?!??!

I guess its got something to do with the fact that match itself is a macro?

Is there some other way that I could extend match to only match when the
variable is not nil?

Thanks,
David



-- 
David Jagoe

davidja...@gmail.com
+18053284389

-- 
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 that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en