Re: exception in 'map' mutates result to nil -- bug?

2012-12-03 Thread Hank
I opened a bug report, let's see what the pros have to say on this: http://dev.clojure.org/jira/browse/CLJ-1119 -- 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

Re: (def some? (comp not nil? some))

2012-12-03 Thread Niels van Klaveren
That's why Jim mentions if-let and when-let in combination with some, they both detect if results are nil. On Sunday, December 2, 2012 10:11:24 PM UTC+1, Ben wrote: On Sun, Dec 2, 2012 at 12:48 PM, Jim - FooBar(); jimpi...@gmail.comjavascript: wrote: Its perfectly fine to use some as a

Re: understanding 'binding' use in clojure.java.jdbc

2012-12-03 Thread Matthias Cords
Hi, I found database connection pools to be the right thing to use with c.j.jdbc and multiple databases. https://clojars.org/org.bituf/clj-dbcp (let [conn1 (make-pool-1) conn2 (make-pool-2)] (sql/with-connection conn1 (sql/with-query-results r [select ...] (sql/with-connection

Re: exception in 'map' mutates result to nil -- bug?

2012-12-03 Thread Christophe Grand
This behavior has the same source as CLJ-457. Applying my patch for CL-457, I get: user= (def mapped (map (fn [_] (throw (Exception.))) [1 2 3])) #'user/mapped user= mapped Exception user/fn--1 (NO_SOURCE_FILE:1) (user= mapped RuntimeException Recursive seq realization

Re: exception in 'map' mutates result to nil -- bug?

2012-12-03 Thread Hank
Ah thanks many times. I saw 457 when I searched the issue list before opening a new one but it wasn't clear to me they were related. I shall use your patch in my private fork. On Tuesday, 4 December 2012 01:06:03 UTC+11, Christophe Grand wrote: This behavior has the same source as CLJ-457.

group-by vs. reducers?

2012-12-03 Thread László Török
Hi, As I was trying to wrap my head around the reducers library[1], I thought implementing group-by would be a good exercise to gain some insight. After spending a few hours with it, I'm still pretty much clueless, so hope to find someone here to help me out: So if I understood the reducer

Re: small error on clojure.org/reader

2012-12-03 Thread Otto Allmendinger
Oops - you'd think I'd be able to match braces by now ;-) I must admit that I don't know how to write this more clearly either without a large rewrite, so it probably is best to just leave it as it is. On Sunday, December 2, 2012 11:28:21 PM UTC+1, Andy Fingerhut wrote: The full sentence is

ANN Monger 1.4.0 is released

2012-12-03 Thread Michael Klishin
Monger (http://clojuremongodb.info) is an idiomatic Clojure MongoDB driver for a more civilized age. It has batteries included, offers powerful expressive query DSL, strives to support every MongoDB 2.0+ feature and has sane defaults. It also has solid documentation. `1.4.0` is a minor *almost

Re: [ANN] vectorz-clj - high performance vector maths for Clojure

2012-12-03 Thread Herwig Hochleitner
I think this is a great addition to the ecosystem, thanks! Right now I'm considering doing a small game, just to give it a try. 2012/12/2 Mikera mike.r.anderson...@gmail.com Sure - added instructions and uploaded version 0.0.1 to Clojars. Hopefully that works smoothly, any issues let me

Re: [ANN] vectorz-clj - high performance vector maths for Clojure

2012-12-03 Thread Michael Gardner
On Dec 2, 2012, at 06:24 , Mikera mike.r.anderson...@gmail.com wrote: Contributions / comments / suggestions very welcome. API is not yet set in stone, so I'm very open to ideas on how to make it better. Since the vast majority of physical applications will use 2D or 3D vectors, did you

clojurescript browser repl possible regression

2012-12-03 Thread Brent Millare
Using clojurescript 3842d3f9e0d68853077117a919e93e169079 Trying to do the simplest case of a clojurescript browser repl: running clojurescript/script/repl, then Taken straight from the documentation: (require '[cljs.repl :as repl])(require '[cljs.repl.browser :as browser]) ;; require the

Re: clojurescript browser repl possible regression

2012-12-03 Thread Brent Millare
I've already tried both ways. Creating the html file with the script tag with the simple code you showed, and just simply trying to connect directly with http://localhost:9000/repl. In both cases, the same error message shows. Note that the error message isn't from my source code, but rather

Re: confused about the scope of variables, or is it something else? ClojureScript

2012-12-03 Thread Arash Bizhan zadeh
So what should I do? would using fmap helps? I have used let initially, but I moved away to make it as close as possible to my repl code/. On Sunday, December 2, 2012 8:31:55 PM UTC-5, Sean Corfield wrote: Part of it is laziness: map is lazy so it doesn't do anything unless you use the

Re: clojurescript browser repl possible regression

2012-12-03 Thread David Nolen
Don't call your file repl.* this has special meaning - it's the file that's meant to be loaded into the cross page iframe. On Monday, December 3, 2012, Brent Millare wrote: I've already tried both ways. Creating the html file with the script tag with the simple code you showed, and just simply

Re: clojurescript browser repl possible regression

2012-12-03 Thread Brent Millare
The file with the clojurescript and call to connect isn't named repl, its named view.html. repl is the name of the response from the call (repl/connect http://localhost:9000/repl;) On Monday, December 3, 2012 3:29:13 PM UTC-5, David Nolen wrote: Don't call your file repl.* this has special

Re: clojurescript browser repl possible regression

2012-12-03 Thread David Nolen
It sounds like you are trying to navigate to http://localhost:9000/replthough right? You should be navigating to http://localhost:9000/ On Mon, Dec 3, 2012 at 8:51 PM, Brent Millare brent.mill...@gmail.comwrote: The file with the clojurescript and call to connect isn't named repl, its named

Re: understanding 'binding' use in clojure.java.jdbc

2012-12-03 Thread Sean Corfield
FWIW, the c.j.jdbc docs have an example of connection pooling: http://clojure.github.com/java.jdbc/doc/clojure/java/jdbc/ConnectionPooling.html On Mon, Dec 3, 2012 at 6:03 AM, Matthias Cords schlafbo...@gmail.comwrote: Hi, I found database connection pools to be the right thing to use with

Easy update function for nested structures

2012-12-03 Thread JvJ
I'm wondering if there's something that can be used like update-in, but with multiple key-lists and values. Like, for example, taking a list of [x y] coordinates for a 2-dimensional array, and changing the values at all of those coordinates. -- You received this message because you are

Re: clojurescript browser repl possible regression

2012-12-03 Thread Brent Millare
At the moment, all I am doing is dragging and dropping the html file into the browser, which contains the compiled clojurescript (js) which looks like this view.html ... compiled cljs stuff ... body scriptfoo.main();/script /body ... Where foo.cljs is: (ns foo (:require

Re: Easy update function for nested structures

2012-12-03 Thread László Török
Hi, how about (reduce #(update-in % %2 tf) arr2d list-of-coordinates) given you 2d array is a vector of vectors and you supply a tf update function? Las 2012/12/3 JvJ kfjwhee...@gmail.com I'm wondering if there's something that can be used like update-in, but with multiple key-lists and

Allowed characters in namespaces

2012-12-03 Thread James Reeves
I've noticed that the + character can be used in namespaces without seeming to cause any issues, e.g. (ns app.view.posts+comments) This also appears to work fine when there is AOT compilation, with the symbol being munged in the same way a function name would be. Is it a good idea to

Re: clojurescript browser repl possible regression

2012-12-03 Thread David Nolen
file:// urls don't work anymore due to changes in the Google Closure Library. You need to point your browser to http://localhost:9000/, by default it looks for index.html. David On Mon, Dec 3, 2012 at 10:05 PM, Brent Millare brent.mill...@gmail.comwrote: At the moment, all I am doing is

Re: clojurescript browser repl possible regression

2012-12-03 Thread Brent Millare
Still getting the same error regardless. 1. creating index.html (with compiled cljs code and call to connect) and putting in clojurescript directory 2. starting up clojurescript clojure repl with ./script/repl 3. Running the clojurescript repl with: (require '[cljs.repl :as repl]) (require

Re: Easy update function for nested structures

2012-12-03 Thread JvJ
OK thanks. I guess that's sufficiently terse. I was just wondering if there was a single built-in function for it. On Monday, 3 December 2012 17:37:04 UTC-5, Las wrote: Hi, how about (reduce #(update-in % %2 tf) arr2d list-of-coordinates) given you 2d array is a vector of vectors and

Re: clojurescript browser repl possible regression

2012-12-03 Thread Mimmo Cosenza
Have you tried using lein-cljsbuild 0.2.9 plugin without specifying any CLJS version in the :dependencies? mimmo On Dec 4, 2012, at 1:02 AM, Brent Millare brent.mill...@gmail.com wrote: Still getting the same error regardless. 1. creating index.html (with compiled cljs code and call to

CLJS: Q about the js-code downloaded by the browser REPL connection...

2012-12-03 Thread Frank Siebenlist
David mentioned in another thread that … the file that's meant to be loaded into the cross page iframe… I noticed that before, but it always puzzled me - time to ask the Q. Could someone please explain why the REPL downloads essentially the same js-code when it connects as the js-code that

Re: clojurescript browser repl possible regression

2012-12-03 Thread David Nolen
Please create a minimal project that demonstrates the issue for you, then we can try to run that. On Tue, Dec 4, 2012 at 12:02 AM, Brent Millare brent.mill...@gmail.comwrote: Still getting the same error regardless. 1. creating index.html (with compiled cljs code and call to connect) and

Re: Ann: cljs-uuid-utils (Re: CLJS: UUID generator for ClojureScript)

2012-12-03 Thread Frank Siebenlist
Added a uuid-string getter function to obtain a string representation of a UUID-instance, which makes for easier interop with apps that require such a uuid-string, like web-app, json, databases (i.e. legacy apps that have not been made EDN-aware yet ;-) ) (thanks to Robert Stuttaford for the

Re: clojurescript browser repl possible regression

2012-12-03 Thread Brent Millare
https://github.com/downloads/bmillare/dj.web.browser/minimal.tar.gz @Mimmo, I don't use cljsbuild as thats mainly for automation that doesn't fit my use cases. Instead I am using the github clojurescript docs for this reference project. Normally, I use my own build tools. I created a minimal

ANN: contrib-repl

2012-12-03 Thread Robert Levy
John Aspden posted an interesting question on Stack Overflow about adding all of the latest versions of contrib libraries as dependencies in a REPL session. The question and my response can be found here:

Re: ANN: contrib-repl

2012-12-03 Thread Meikel Brandmeyer (kotarak)
Hi, may I suggest a different solution? Create a meta project, which just depends on all the contrib libraries and specify this as a dependency in your project. In other parts of the world this is called a BOM - a bill of material. Kind regards Meikel -- You received this message because

Re: ANN: contrib-repl

2012-12-03 Thread rob
That was my first thought, and considered also generating a project.clj, but after thinking about it I decided I didn't want to encourage this type of behavior beyond REPL experimentation, so I preferred to do it in a way that focuses on the REPL. On Tuesday, December 4, 2012 2:24:38 AM UTC-5,

Re: ANN: contrib-repl

2012-12-03 Thread Laurent PETIT
2012/12/4 rob r.p.l...@gmail.com: That was my first thought, and considered also generating a project.clj, but after thinking about it I decided I didn't want to encourage this type of behavior beyond REPL experimentation, so I preferred to do it in a way that focuses on the REPL. Hi, Really