Re: ANN: clojure.java.jdbc 0.0.7

2011-10-12 Thread Sean Corfield
On Wed, Oct 12, 2011 at 1:42 AM, keeds wrote: > I'm having problems with MS Access ODBC driver with JDBC ODBC bridge and > parameterised statements. Given how flawed MS Access is, I'm not sure it's an appropriate target for clojure.java.jdbc but if you can provide more detail about exactly what q

Re: Is it possible to make a mirror of clojure.org?

2011-10-12 Thread Tom Faulhaber
It's also possible to pull a zip file of the API docs just by following this link: https://github.com/clojure/clojure/zipball/gh-pages. Another approach, if you're a git-head, is just to clone the clojure repo: $ git clone git://github.com/clojure/clojure.git api-docs $ cd api-docs $ git checkout

Re: tools.logging vs clojure.contrib.logging

2011-10-12 Thread jingguo
Sean: The links give me a clear answer. On Oct 13, 2:30 am, peta wrote: > On clojure.org the libraries link at the bottom of the left bar should > take you Clojure+Contrib because thats about as close to official > libraries as clojure gets. > The Clojure+Contrib page can reference the community

Re: NodeJS REPL

2011-10-12 Thread Devin Walters
I wanted one of these the other day. Great stuff. I'm looking forward to toying around with it as well. On Wednesday, October 12, 2011 at 5:44 PM, Michael Fogus wrote: > David's right about :nodejs. Thank you for this contribution. I can't wait to > play around with it. If some ideas come to m

Re: confusion about refs

2011-10-12 Thread Devin Walters
That is a very good explanation. On Wednesday, October 12, 2011 at 6:28 PM, Kevin Downey wrote: > refs, called as a function, try to call the value they hold as a > function with the given arguments > > ((first @my-contacts) :fname) ~= (:fname @(first @my-contacts)) > > basically you have tw

Re: Is it possible to make a mirror of clojure.org?

2011-10-12 Thread Rob Lachlan
Ignore my last message. For some reason, you need the --no-cookies option for wget to recurse on this website. No idea why. So I ended up using something like wget -x -m -k -H -Dclojure.org --no-cookies --html-extension http://clojure.org You may have to play around a bit to pull down exactly

Re: Should intern obey :dynamic?

2011-10-12 Thread Armando Blancas
> Seems to me that if you're going to use metadata to communicate intention > about dynamic binding in *one* way of creating a new var, you should do it > with *all* ways of creating a new var. And you may be right. My point was that a var's dynamic nature is part of its state: it's primarily da

Re: [ANN] dj 0.1.0 released

2011-10-12 Thread Daniel Jomphe
I'll add this context: https://github.com/bmillare/dj "dj takes the cacaphony of java, git, clojure, and build tools and mixes it into something harmonious." In a nutshell, dj is an attempt to make a clojure distribution. Like leiningen and maven, dj resolves dependencies, however, dj tries to

Re: confusion about refs

2011-10-12 Thread Kevin Downey
refs, called as a function, try to call the value they hold as a function with the given arguments ((first @my-contacts) :fname) ~= (:fname @(first @my-contacts)) basically you have two levels of refs, but are only derefing once, but by happy accident ((first @my-contacts) :fname) works On Wed,

confusion about refs

2011-10-12 Thread qhfgva
I was trying out an example from Practical Clojure and I don't understand why I get different results below? Can someone enlighten me? user=> @my-contacts [# # #] user=> (:fname (first @my-contacts)) nil user=> ((first @my-contacts) :fname) "Luke" Why would the placement of :fname change how it

Re: NodeJS REPL

2011-10-12 Thread Michael Fogus
David's right about :nodejs. Thank you for this contribution. I can't wait to play around with it. If some ideas come to mind I will provide feedback. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googl

Re: Spread work onto multiple threads (in pure Clojure)

2011-10-12 Thread j-g-faustus
On Tuesday, October 11, 2011 8:07:16 PM UTC+2, Andy Fingerhut wrote: > If it were implemented not by creating Java Threads for each task, but submitting a task to an ExecutorService... As far as I understand, that's easy if you're willing to use it asynchronously: Push tasks on the queue, let th

Re: Should intern work within a try block?

2011-10-12 Thread Brian Marick
On Oct 12, 2011, at 3:29 PM, Chris Perkins wrote: > Nothing to do with try - clojure is trying to compile the whole top-level > form. Same thing happens with any top-level form (other than do, which is > special). What I sent earlier was the result of simplifying more complicated code, which

Re: Should intern obey :dynamic?

2011-10-12 Thread Brian Marick
On Oct 12, 2011, at 3:49 PM, Armando Blancas wrote: >> The metadata tells you why: >> >> user=> (meta #'*dynamo*) >> {:ns #, :name *dynamo*, :dynamic true, :line 1, :file >> ...} > > The var tells you why: > user=> (.isDynamic (var *dynamo*)) > true The mere human who has not read Var

Re: Exception handling changes in Clojure 1.3.0

2011-10-12 Thread Kevin Downey
On Wed, Oct 12, 2011 at 12:00 PM, Marshall T. Vandegrift wrote: > Stuart Sierra writes: > >> I was a little worried about this when the exception behavior for fns was >> changed. I think it's solvable, but don't know right now what the solution >> is. > > I'm not incredibly experienced with Java,

Re: Exception handling changes in Clojure 1.3.0

2011-10-12 Thread Ben Smith-Mannschott
I've attached a RFC patch based on this idea to CLJ-855. http://dev.clojure.org/jira/browse/CLJ-855 // Ben On Wed, Oct 12, 2011 at 22:02, Stefan Kamphausen wrote: > Just for the record: That's how I understood Ivan's idea, too.  Introduce a > special exception type which is used nowhere else a

Re: Spread work onto multiple threads (in pure Clojure)

2011-10-12 Thread Lee Spector
On Oct 12, 2011, at 4:41 PM, Avram wrote: > I haven't read the entire thread carefully, but have you considered > the "work" library as a potential > fit for what you are trying to do? I hadn't heard of it, but it does look promising and I will check it out. T

Re: Should intern obey :dynamic?

2011-10-12 Thread Armando Blancas
> The metadata tells you why: > >     user=> (meta #'*dynamo*) >     {:ns #, :name *dynamo*, :dynamic true, :line 1, :file ...} The var tells you why: user=> (.isDynamic (var *dynamo*)) true > > Now let's make another variable with `intern`, copying the metadata from > `*dynamo*`: >     user=> (

Re: Spread work onto multiple threads (in pure Clojure)

2011-10-12 Thread Avram
I haven't read the entire thread carefully, but have you considered the "work" library as a potential fit for what you are trying to do? Example from the github link: user> (require '[work.core :as work]) user> (work/map-work client/get ["http://clojure.org"; "h

Re: tools.logging vs clojure.contrib.logging

2011-10-12 Thread peta
On clojure.org the libraries link at the bottom of the left bar should take you Clojure+Contrib because thats about as close to official libraries as clojure gets. The Clojure+Contrib page can reference the community/libraries page if it wants. Also I find heading "Where Did Clojure.Contrib Go".

Re: Should intern work within a try block?

2011-10-12 Thread Chris Perkins
Nothing to do with try - clojure is trying to compile the whole top-level form. Same thing happens with any top-level form (other than do, which is special). user> (do (intern *ns* 'foo 23) foo) 23 user> (when true (intern *ns* 'bar 44) bar) ; Evaluation aborted. -- You received this message

[ANN] dj 0.1.0 released

2011-10-12 Thread Brent Millare
I've been using dj for a while for personal use but I never put a version on it. Hopefully doing this from now on I might get more useful feedback. git://github.com/bmillare/dj.git Main changes are: * Runtime altering classpath * Runtime dependency resolution * Runtime reloading of select class

Should intern work within a try block?

2011-10-12 Thread Brian Marick
This works: (intern *ns* '*copy1* "value") (prn *copy1*) This doesn't: (try (intern *ns* '*copy2* "value") (prn *copy2*) (finally (prn "I survived!"))) Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: *copy2* in this context, compi

Re: Exception handling changes in Clojure 1.3.0

2011-10-12 Thread Stefan Kamphausen
Just for the record: That's how I understood Ivan's idea, too. Introduce a special exception type which is used nowhere else and unwrap that automatically. I am not experienced enough a Java programmer to know all the implications that may arise here and there. Regards, Stefan -- You receiv

Should intern obey :dynamic?

2011-10-12 Thread Brian Marick
Consider this ordinary way of defining a dynamic variable: user=> (def ^:dynamic *dynamo* 3) As you'd expect, you can rebind: user=> (binding [*dynamo* "new value"] *dynamo*) "new value" The metadata tells you why: user=> (meta #'*dynamo*) {:ns #, :name *dynamo*, :dynamic t

Re: Is it possible to make a mirror of clojure.org?

2011-10-12 Thread Rob Lachlan
Many of the links off of the main page are ajax. I don't think that wget can scrape that very easily. On Oct 12, 11:10 am, Tassilo Horn wrote: > jingguo writes: > > Hi! > > > When programming in Clojure, I use the Reference documentation on > > clojure.org a lot. But my network condition is hor

Re: Exception handling changes in Clojure 1.3.0

2011-10-12 Thread Marshall T. Vandegrift
Stuart Sierra writes: > I was a little worried about this when the exception behavior for fns was > changed. I think it's solvable, but don't know right now what the solution > is. I'm not incredibly experienced with Java, but would using a Java construct which tricks the language into allowin

Re: NodeJS REPL

2011-10-12 Thread David Nolen
Nice! I think :target :nodejs is just about guaranteeing that some Node.js definitions like 'require' are in place and providing a more sensible print fn. David On Wed, Oct 12, 2011 at 11:48 AM, kurtharriger wrote: > I took a stab at writing a repl for nodejs. > > The node documentation has an e

Re: ClojureScript memoize throws error

2011-10-12 Thread David Nolen
Thanks for the report, CLJS-62 reopened, http://dev.clojure.org/jira/browse/CLJS-62 David On Wed, Oct 12, 2011 at 2:10 PM, Praki wrote: > I am running into a problem with memoized functions in ClojureScript. > Functions which take a single argument work okay but functions of two > args throw an

Re: Libraries supporting 1.3&1.2 and bignums

2011-10-12 Thread Brian Marick
On Oct 12, 2011, at 3:13 AM, Meikel Brandmeyer (kotarak) wrote: > So the library has several options: Since the numeric changes in this area > are breaking changes, the library has to either a) take overflow policy into > its contract Midje's contract for 1.3 numerics is: if there are overflow

ClojureScript memoize throws error

2011-10-12 Thread Praki
I am running into a problem with memoized functions in ClojureScript. Functions which take a single argument work okay but functions of two args throw an error. I haven't been able to isolate the bug (I am able to hash vectors and nested vectors just fine). Any hints on the root cause or workaroun

Re: Is it possible to make a mirror of clojure.org?

2011-10-12 Thread Tassilo Horn
jingguo writes: Hi! > When programming in Clojure, I use the Reference documentation on > clojure.org a lot. But my network condition is horrible. So I want to > make a off-line copy. I have tried "wget -x -m -k http://clojure.org"; > to make a mirror of clojure.org. But it does not work. First

Re: Exception handling changes in Clojure 1.3.0

2011-10-12 Thread Chas Emerick
On Oct 12, 2011, at 1:21 PM, Sean Corfield wrote: > On Wed, Oct 12, 2011 at 7:37 AM, Stefan Kamphausen > wrote: >> To my humble ears this sounds like the best idea so far. Something like >> ClojureRTException ... > > The problem - in Clojure code using try/catch - is that you don't know > whe

Re: The Website / Wikispaces

2011-10-12 Thread Sean Corfield
Just to swim against the flow: I've never seen confusion between clojure.org and wikispaces so I've been watching this thread with interest and bewilderment. Can someone provide a tried and true navigation path that shows this problem? If it's as common as this thread would suggest, I'm really surp

Re: Exception handling changes in Clojure 1.3.0

2011-10-12 Thread Sean Corfield
On Wed, Oct 12, 2011 at 7:37 AM, Stefan Kamphausen wrote: > To my humble ears this sounds like the best idea so far.  Something like > ClojureRTException ... The problem - in Clojure code using try/catch - is that you don't know whether the real exception will be wrapped or not (because you may b

Re: tools.logging vs clojure.contrib.logging

2011-10-12 Thread Sean Corfield
On Wed, Oct 12, 2011 at 8:06 AM, jingguo wrote: > Is tools.logging is a replacement of clojure.contrib.logging? > Which one should I use? If these pages could be more clear on answering your question, please let me know and I'll update them: http://dev.clojure.org/display/doc/Clojure+Contrib htt

Is it possible to make a mirror of clojure.org?

2011-10-12 Thread jingguo
When programming in Clojure, I use the Reference documentation on clojure.org a lot. But my network condition is horrible. So I want to make a off-line copy. I have tried "wget -x -m -k http://clojure.org"; to make a mirror of clojure.org. But it does not work. Can anybody help me on this? Thanks.

NodeJS REPL

2011-10-12 Thread kurtharriger
I took a stab at writing a repl for nodejs. The node documentation has an example of starting a repl that listens on a socket: http://nodejs.org/docs/v0.3.1/api/repl.html Using this I attempted to implement repl/IJavaScriptEnv with some degree of success. I had a little bit of trouble determinin

Re: Shameless self promotion - JavaOne

2011-10-12 Thread Dennis
Here is the slide deck uploaded to slideshare: http://www.slideshare.net/shr3kst3r/java-one-2011-monitoring-a-largescale-infrastructure-with-clojure Sorry for the delay -- Dennis On Wed, Oct 5, 2011 at 12:44 AM, Dennis wrote: > Good idea.  I am having problems with slideshare displaying the > p

Re: tools.logging vs clojure.contrib.logging

2011-10-12 Thread jingguo
Jonathan: Thanks. On Oct 12, 11:15 pm, Jonathan Fischer Friberg wrote: > As I understand it, tools.logging was created from clojure.contrib.logging > (but has been updated since). > > In any case; if there exists a library in clojure/, which can perform the > same things as some part of contrib,

Re: tools.logging vs clojure.contrib.logging

2011-10-12 Thread Jonathan Fischer Friberg
As I understand it, tools.logging was created from clojure.contrib.logging (but has been updated since). In any case; if there exists a library in clojure/, which can perform the same things as some part of contrib, use the clojure/ one. On Wed, Oct 12, 2011 at 5:06 PM, jingguo wrote: > Is tool

tools.logging vs clojure.contrib.logging

2011-10-12 Thread jingguo
Is tools.logging is a replacement of clojure.contrib.logging? Which one should I use? -- 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

Re: Exception handling changes in Clojure 1.3.0

2011-10-12 Thread Stefan Kamphausen
Hi, To my humble ears this sounds like the best idea so far. Something like ClojureRTException ... Regards, Stefan -- 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 n

Re: The Website / Wikispaces

2011-10-12 Thread jingguo
I do with the use of Chrome browser. On Oct 12, 10:30 pm, Chas Emerick wrote: > Wikispaces does some strange https redirects through its own domain for > session handling.  If your agent doesn't react as it expects, you can end up > in all sorts of strange places (including having no way to get

Re: The Website / Wikispaces

2011-10-12 Thread Chas Emerick
Wikispaces does some strange https redirects through its own domain for session handling. If your agent doesn't react as it expects, you can end up in all sorts of strange places (including having no way to get to clojure.org at all if your internet connection disallows https entirely, i.e. som

Re: Exception handling changes in Clojure 1.3.0

2011-10-12 Thread Meikel Brandmeyer (kotarak)
Hi, Am Mittwoch, 12. Oktober 2011 15:19:21 UTC+2 schrieb miner: > > I've done something like this in Java projects but without any magic > unwrapping. It worked well. Manual unwrapping wasn't too onerous in the > rare cases where we wanted to do so. The Clojure-specific exception should > be

Re: Exception handling changes in Clojure 1.3.0

2011-10-12 Thread Steve Miner
I've done something like this in Java projects but without any magic unwrapping. It worked well. Manual unwrapping wasn't too onerous in the rare cases where we wanted to do so. The Clojure-specific exception should be part of the public API for Java interop. Don't try to hide it. On Oct 12

Re: The Website / Wikispaces

2011-10-12 Thread Stuart Sierra
I saw this effect when using wget on http://clojure.org/ but I can't explain it either. -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 -

Re: ISeq protocol-like support

2011-10-12 Thread Stuart Sierra
Rumor has it that Java 8 will have something called Interface Injection, a way to apply Java interfaces to pre-existing classes the way you can with Clojure protocols. That would be pretty cool. -S -- You received this message because you are subscribed to the Google Groups "Clojure" group. To

Re: ANN: clojure.java.jdbc 0.0.7

2011-10-12 Thread Stuart Sierra
Thanks for the quick release of JDBC-17! -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 unsu

Re: Exception handling changes in Clojure 1.3.0

2011-10-12 Thread Ivan Koblik
I wonder, would it be possible to throw a custom exception (something like DoNotUse_InternalRuntimeException) in Reflector.java, and update try/catch code to always unwrap it? Cheers, Ivan. On 12 October 2011 03:44, pmbauer wrote: > I don't know what the right solution is either, but here is a

Re: Libraries supporting 1.3&1.2 and bignums

2011-10-12 Thread Meikel Brandmeyer (kotarak)
Hi, yes. In 1.2 the ' will be not part of the symbol +, but it will be attached to the following 1, quoting it. The reader of 1.3 will consume the ' as part of the + symbol. To clarify this a little: 1.2 sees: [+ '1] (<=> [+ (quote 1)]) 1.3 sees: [+' 1] Too "outrageously clever" for my taste,

Re: Libraries supporting 1.3&1.2 and bignums

2011-10-12 Thread Ivan Koblik
I feel myself silly, but could you explain how does this work? (def +M (first [+' 1])) Is it some kind of reader level trick? Cheers, Ivan. On 11 October 2011 04:25, Alan Malloy wrote: > (def +M (first [+' 1])) seems like it should work in both versions? > > On Oct 10, 4:28 pm, Brian Marick

Re: ISeq protocol-like support

2011-10-12 Thread Stathis Sideris
Thanks, the bootstraping and performance explanations both make sense. I guess questions like that arise because Clojure tries to accomodate both the Java type system and its own, and sometimes there is tension between the two... On Oct 11, 11:01 pm, Stuart Sierra wrote: > Nope, the core interfac

Re: ANN: clojure.java.jdbc 0.0.7

2011-10-12 Thread keeds
I have been converting a project to Clojure 1.3 which meant moving to clojure.java.jdbc. I'm having problems with MS Access ODBC driver with JDBC ODBC bridge and parameterised statements. I've just tried 0.0.7 and still have the same problem: Exception in thread "main" java.lang.RuntimeException

Re: Libraries supporting 1.3&1.2 and bignums

2011-10-12 Thread Meikel Brandmeyer (kotarak)
Hi Chas, someone specifying (roughly 9223372036854775804 5) also accepts 9223372036854775808 as a possible value. So she has to at least think a tiny bit about overflow. However you are right that she should not be concerned about the specific implementation of roughly. So the library has seve

Re: Libraries supporting 1.3&1.2 and bignums

2011-10-12 Thread Meikel Brandmeyer (kotarak)
Hi, Besides the hack by Alan you might also want to think about an overflow save implementation for roughly: user=> (defn roughly [expected-value delta] (let [exp-pos? (pos? expected-value) upper(if (neg? delta) (- delta) delta) lower(- upp