Re: ANN: core.match 0.2.0-alpha5

2011-10-11 Thread Stephen Wrobleski
On Mon, Oct 10, 2011 at 09:24:09PM -0400, David Nolen wrote: > I'm not following. Getting accurate information about what failed to match > needs to be integrated. Given that match makes no restrictions on types > there's not much we can do except communicate where we were when the match > failed v

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

2011-10-11 Thread Michael Gardner
Just to throw in my two cents here: it would really be a shame for Clojure's pmap to continue to languish in the state it's currently in (i.e. nearly useless). Even though implementing an alternative using thread pools isn't too hard, it hurts the Clojure concurrency sales pitch-- I can't tell p

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

2011-10-11 Thread Tassilo Horn
Andy Fingerhut writes: Hi Andy, > pmap will limit the maximum number of simultaneous threads. So will > the medusa library's medusa-pmap. > > The difference is that if one job early in the list takes, e.g., 100 > times longer than the next 20, and you have 4 cpus available, pmap > will start th

Re: Is clojure.data.json compatible with 1.3?

2011-10-11 Thread sunng
Are you sure ? I got dump when using clojure.data.json 0.1.1 with clojure 1.3 Caused by: java.lang.NoSuchMethodError: clojure.lang.Numbers.isNeg(I)Z at clojure.data.json$read_json_reader.invoke(json.clj:114) at clojure.data.json$fn__912.invoke(json.clj:175) at clojure.data.

Re: Reactions to google dart?

2011-10-11 Thread Sidharth Kshatriya
The thing that they are keeping "secret" is putting the Dart VM in the browser. I thinks that is when things might get interesting * The Dart VM will allow loading "images" of a program ala smalltalk. This will solve the startup problems associated with programs like gmail. * The Language grammar

Re: Is clojure.data.json compatible with 1.3?

2011-10-11 Thread Stuart Sierra
Looks like you may have some AOT-compiled code in there. The new contrib libraries are distributed as source-only JAR files, so perhaps you have some old .class files in your project? Try a clean build and see if the same error appears. Thanks, -Stuart Sierra clojure.com -- You received this

Re: Suggestion needed for namespace management in modular clojure app

2011-10-11 Thread Stuart Sierra
> Not just clojure. Solution for clojure only code is > simple. The application is a framework, which will expose > some API and modules consuming the API, can be written in > any JVM language. It is known that all modules will run > from same instance of JVM. Sounds like you may need something mo

Re: ANN: core.match 0.2.0-alpha5

2011-10-11 Thread Ambrose Bonnaire-Sergeant
On Tue, Oct 11, 2011 at 4:25 PM, Stephen Wrobleski wrote: > On Mon, Oct 10, 2011 at 09:24:09PM -0400, David Nolen wrote: > > I'm not following. Getting accurate information about what failed to > match > > needs to be integrated. Given that match makes no restrictions on types > > there's not much

Bug in str fun affecting keyword fn and other downstream functions?

2011-10-11 Thread Dave Sann
Hi all, I have been trying to get the browser repl to work tonight. I can't get this to work and have tracked the issue down to an apparent problem with the keyword function. I have not seen this behaviour before. I pulled the latest clojurescript today. This may be a problem with my setup. Has

Re: read-string behavior in ClojureScript

2011-10-11 Thread David Nolen
Looks like a bug, ticket created - http://dev.clojure.org/jira/browse/CLJS-85 On Tue, Oct 11, 2011 at 2:16 AM, Praki wrote: > In Clojure (read-string ":a:b:c") returns :a:b:c (a keyword with two > embedded colons) whereas ClojureScript returns :a. In ClojureScript > reading of a token ends at wh

Re: Is clojure.data.json compatible with 1.3?

2011-10-11 Thread sunng
Thank you for your response. Finally I found it has something to do with the autodoc plugin. Although I have exclude clojure and clojure-contrib from the dev- dependencies, it seems there is still strange effect with the plugin. I have no idea about that. On Oct 11, 8:25 pm, Stuart Sierra wrot

Re: Bug in str fun affecting keyword fn and other downstream functions?

2011-10-11 Thread David Nolen
Apologies in trying to fix CLJS-84, I broke some things. This is backed out now and in its own branch. David On Tue, Oct 11, 2011 at 9:16 AM, Dave Sann wrote: > Hi all, > > I have been trying to get the browser repl to work tonight. > I can't get this to work and have tracked the issue down to

Re: Libraries supporting 1.3&1.2 and bignums

2011-10-11 Thread Brian Marick
On Oct 10, 2011, at 7:50 PM, Kevin Downey wrote: > (defmacro plus [] (if … (resolve (symbol "clojure.core/+")) (resolve > (symbol "clojure.core/+'" > > ((plus) actual delta) Thanks. On Oct 10, 2011, at 9:25 PM, Alan Malloy wrote: > (def +M (first [+' 1])) seems like it should work in both

Re: Reactions to google dart?

2011-10-11 Thread Timothy Washington
I believe this is google's official blog to discuss and track issues around Dart : Google's leaked memo about the Future of Javascript says that Dart (formerly Dash) wants to make a "*clean break*" from the current Ja

Re: clojure.contrib.base64

2011-10-11 Thread Rok Lenarcic
What about compared to the library I listed in the OP? On Oct 10, 8:37 pm, Alexander Taggart wrote: > I see about a 50% increased throughput over apache commons-codec as well.  I > use the perf-base64 ns generate input data and output timing files to keep > track of changes to the performance ove

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

2011-10-11 Thread Lee Spector
On Oct 11, 2011, at 7:56 AM, Tassilo Horn wrote: > So indeed, one starts with the number of available processors + 2, and > one single longer running task will wipe out any parallelism. :-( > > IMO, that's not what 99% of the users would expect nor want when calling > (pmap foo coll). I'd vote f

Re: Faster JSON library

2011-10-11 Thread Sean Corfield
Nice! This will let me remove some workarounds for reflection warnings I was getting and probably give me better performance too :) I'll try to run tests against 1.4.0-master-SNAPSHOT today (that'll have this change, right?). Sean On Fri, Oct 7, 2011 at 1:20 PM, Stuart Halloway wrote: > This re

Re: Exception handling changes in Clojure 1.3.0

2011-10-11 Thread Sean Corfield
Would a good solution to this be for try/catch to _automatically_ unroll RTE if there's no matching Exception class specified? I understand _why_ the change to wrap exceptions was made but without the equivalent unwrapping in try/catch this just moves the pain from the library/language out to the

Re: Reactions to google dart?

2011-10-11 Thread Francesco Bellomi
I think Dart could be an interesting lower-level target language, if the dart VM will prove to be intrinsically better than the JS VM. Francesco On Tuesday, October 11, 2011 10:14:33 AM UTC+2, Sidharth Kshatriya wrote: > > The thing that they are keeping "secret" is putting the Dart VM in the

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

2011-10-11 Thread j-g-faustus
On Tuesday, October 11, 2011 3:55:09 AM UTC+2, Lee wrote: > > > Does your pmap-pool permit nesting? (That is, does it permit passing > pmap-pool a function which itself calls pmap-pool?). If so then that would > be a reason to prefer it over my pmapall. > I expect it would be possible to nest it

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

2011-10-11 Thread Andy Fingerhut
One benefit would be convenience of enabling parallelism on nested data structures. One function at the top level could use parallelism, and the pieces, perhaps handled by separate functions, and perhaps nested several levels deep in function calls, could also use parallelism. If it were implemen

ISeq protocol-like support

2011-10-11 Thread Stathis Sideris
Hello all, Is it possible make an existing Java class behave as a seq? What I'm really asking I guess, is how come Seqable is not a protocol so that we can say something like (extend-type java.awt.Container clojure.lang.Seqable (seq [this] (my-seq-function this))) I know this can be achieved

Re: Faster JSON library

2011-10-11 Thread Sean Corfield
On Tue, Oct 11, 2011 at 8:47 AM, Sean Corfield wrote: > I'll try to run tests against 1.4.0-master-SNAPSHOT today (that'll > have this change, right?). I get a NPE from the 1.4 compiler on Congomongo. Details reported on clojure-dev. -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- ht

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

2011-10-11 Thread Tassilo Horn
Lee Spector writes: Hi Lee, >> So indeed, one starts with the number of available processors + 2, >> and one single longer running task will wipe out any parallelism. :-( >> >> IMO, that's not what 99% of the users would expect nor want when >> calling (pmap foo coll). I'd vote for making pmap

Re: ISeq protocol-like support

2011-10-11 Thread Alan Malloy
Interfaces are more java-y, which has pluses and minuses. Here for example, I think the compiler itself, which is written in java, needs to be able to seq things (ie, your source-code forms). *Maybe* you could make seqable a protocol, but it would make the compiler much less convenient as implement

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

2011-10-11 Thread Lee Spector
> On Tue, Oct 11, 2011 at 10:55 AM, j-g-faustus > wrote: >> I expect it would be possible to nest it (possible as in "no exceptions or >> deadlocks"), but I can't see any scenario where you would want to - you >> would get an exponentially increasing number of threads. If 48 cores each >> sta

Re: Libraries supporting 1.3&1.2 and bignums

2011-10-11 Thread Meikel Brandmeyer
Hi, Am 11.10.2011 um 01:28 schrieb Brian Marick: > If the 1.3 user has taken care to use promoting-to-bignum arithmetic, it > would be rude to blow up if `actual` happens to be a regular integer but > adding `delta` to it causes an overflow. Maybe I'm a bit bold, but shouldn't a 1.3 user be aw

Re: ANN: core.match 0.2.0-alpha5

2011-10-11 Thread Stephen Wrobleski
On Tue, Oct 11, 2011 at 08:46:51PM +0800, Ambrose Bonnaire-Sergeant wrote: > (match ["asdf"] >(["asdf"] :when (fn [a] ..)) 1) ;; <- illegal, cannot wrap > pattern row in list > > If we can resolve this, it would be great! > > Thanks, > Ambrose > I see a couple of options.. 1. Sc

ANN: clojure.java.jdbc 0.0.7

2011-10-11 Thread Sean Corfield
Changes in 0.0.7: * Fix JDBC-9 by renaming duplicate columns instead of throwing an exception. - thanx to Peter Siewert! * Fix JDBC-16 by ensuring do-prepared works with no param-groups provided. * Fix JDBC-17 by adding type hints to remove more reflection warnings. - thanx to Stuart Sierra! D

Re: ISeq protocol-like support

2011-10-11 Thread Stuart Sierra
Nope, the core interfaces were written before Protocols existed. Making them protocols is a bootstrapping problem, although ClojureScript shows that it may be possible to fix this. If you want to make a Java class seqable, you'll have to wrap it in another type that you create. -Stuart Sierra

Re: Exception handling changes in Clojure 1.3.0

2011-10-11 Thread Stuart Sierra
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. -S -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure

Re: Exception handling changes in Clojure 1.3.0

2011-10-11 Thread pmbauer
Would now be a bad time to observe there was a large change made to the way exceptions are handled, and the lack of guard-rails (no tests for exception handling behavior) may have contributed to this regression? https://github.com/clojure/clojure/commit/8fda34e4c77cac079b711da59d5fe49b74605553 O

Re: Libraries supporting 1.3&1.2 and bignums

2011-10-11 Thread Chas Emerick
On Oct 11, 2011, at 4:17 PM, Meikel Brandmeyer wrote: > Hi, > > Am 11.10.2011 um 01:28 schrieb Brian Marick: > >> If the 1.3 user has taken care to use promoting-to-bignum arithmetic, it >> would be rude to blow up if `actual` happens to be a regular integer but >> adding `delta` to it causes

Re: Libraries supporting 1.3&1.2 and bignums

2011-10-11 Thread Brian Marick
On Oct 11, 2011, at 3:17 PM, Meikel Brandmeyer wrote: > Maybe I'm a bit bold, but shouldn't a 1.3 user be aware, that his limits do > overflow and specify a bigint to begin with? Consider someone who passes in a regular integer to the `roughly` checker. It's near the overflow boundary. That pl

Re: Exception handling changes in Clojure 1.3.0

2011-10-11 Thread Chas Emerick
…or that there's many thousands of tests (or many, many, many thousands of tests if you count all the 3rd party libraries that have been testing against 1.3.0 snapshots for months with nary a related hiccup), many of them related to exceptions and other error conditions, but no one was clever en

Re: Exception handling changes in Clojure 1.3.0

2011-10-11 Thread pmbauer
Fair enough. :) Complete test coverage is intractable. But in clojure, there are only a handful of tests that contain a catch and none that test try/catch semantics. Maybe I'm looking in the wrong place... -- You received this message because you are subscribed to the Google Groups "Clojure" gr

metadata on function objects

2011-10-11 Thread Brian Marick
In 1.2.x, functions defined with defn had metadata attached: user=> (meta odd?) {:ns #, :name odd?, :file "clojure/core.clj", :line 1093, :arglists ([n]), :added "1.0", :doc "Returns true if n is odd, throws an exception if n is not an integer"} In 1.3, this metadata is missing: user=> (meta o

Re: metadata on function objects

2011-10-11 Thread Sean Corfield
On Tue, Oct 11, 2011 at 5:13 PM, Brian Marick wrote: > In 1.3, this metadata is missing: > > user=> (meta odd?) > nil user=> (meta #'clojure.core/odd?) {:ns #, :name odd?, :arglists ([n]), :added "1.0", :static true, :doc "Returns true if n is odd, throws an exception if n is not an integer", :li

Re: metadata on function objects

2011-10-11 Thread Brian Marick
On Oct 11, 2011, at 7:20 PM, Sean Corfield wrote: > user=> (meta #'clojure.core/odd?) > {:ns #, :name odd?, :arglists ([n]), :added > "1.0", :static true, :doc "Returns true if n is odd, throws an > exception if n is not an integer", :line 1323, :file > "clojure/core.clj"} I understand that. Usef

Re: metadata on function objects

2011-10-11 Thread Sean Corfield
On Tue, Oct 11, 2011 at 5:22 PM, Brian Marick wrote: > I understand that. Useful code is sometimes given a function object to work > with, not a Var. Ah, I get your point now... What about: (meta (var odd?)) (meta (resolve 'odd?)) -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- h

Re: metadata on function objects

2011-10-11 Thread Stuart Sierra
I suppose you could iterate over all known Vars and construct a map from fns to the Vars that contain them. Then, given a fn, you can look up the Var and get its metadata. It would break if anyone redefines or binds the Var, of course. -S -- You received this message because you are subscribe

Re: metadata on function objects

2011-10-11 Thread Brian Marick
On Oct 11, 2011, at 7:48 PM, Stuart Sierra wrote: > I suppose you could iterate over all known Vars and construct a map from fns > to the Vars that contain them. Then, given a fn, you can look up the Var and > get its metadata. It would break if anyone redefines or binds the Var, of > course.

Re: metadata on function objects

2011-10-11 Thread Chas Emerick
On Oct 11, 2011, at 8:53 PM, Brian Marick wrote: > > On Oct 11, 2011, at 7:48 PM, Stuart Sierra wrote: > >> I suppose you could iterate over all known Vars and construct a map from fns >> to the Vars that contain them. Then, given a fn, you can look up the Var and >> get its metadata. It woul

Re: metadata on function objects

2011-10-11 Thread Sam Ritchie
I remember not really understanding the way defn hung metadata off of its functions. In 1.2, it returned different responses on successive calls to defn. for example: user> (clojure-version) "1.2.1" user> (defn my-func "a docstring!" [x] x) #'user/my-func user> (meta #'my-func) ;; var first {:ns #

Re: Exception handling changes in Clojure 1.3.0

2011-10-11 Thread Rich Hickey
It's not a regression. It is a known breaking change. The change merely owned up the the fact that we cannot in fact communicate all actual errors through Java code, due to checked exceptions. This is an enduring problem with Java, and you are going to see it rear its ugly head in Java itself a

Re: Exception handling changes in Clojure 1.3.0

2011-10-11 Thread pmbauer
I don't know what the right solution is either, but here is a JIRA ticket with an attached regression test. A start. http://dev.clojure.org/jira/browse/CLJ-855 On Tuesday, October 11, 2011 3:02:47 PM UTC-7, Stuart Sierra wrote: > > I was a little worried about this when the exception behavior fo

Re: ANN: clojure.java.jdbc 0.0.7

2011-10-11 Thread jaime
will the 1.0.0 be included in core or contrib package? On Oct 12, 5:37 am, Sean Corfield wrote: > Changes in 0.0.7: > > * Fix JDBC-9 by renaming duplicate columns instead of throwing an exception. >   - thanx to Peter Siewert! > * Fix JDBC-16 by ensuring do-prepared works with no param-groups pro

Re: ANN: clojure.java.jdbc 0.0.7

2011-10-11 Thread Sean Corfield
On Tue, Oct 11, 2011 at 6:58 PM, jaime wrote: > will the 1.0.0 be included in core or contrib package? The Clojure/core team have indicated they are considering a "batteries included" distribution that will bundle new contrib libraries but the exact form (and version numbers) have not been discus

Re: metadata on function objects

2011-10-11 Thread Alan Malloy
This. Metadata on functions in 1.2 was mostly accidental, from what I can tell. On Oct 11, 6:39 pm, Sam Ritchie wrote: > I remember not really understanding the way defn hung metadata off of its > functions. In 1.2, it returned different responses on successive calls to > defn. for example: > > u

Re: metadata on function objects

2011-10-11 Thread David Nolen
Relevant IRC thread - http://clojure-log.n01se.net/date/2011-03-01.html#12:41 On Tue, Oct 11, 2011 at 8:53 PM, Brian Marick wrote: > > On Oct 11, 2011, at 7:48 PM, Stuart Sierra wrote: > > > I suppose you could iterate over all known Vars and construct a map from > fns to the Vars that contain t

Re: How to Collapse Nested Map into a Sequence of Flat Maps

2011-10-11 Thread Stephen Compall
On Mon, 2011-10-10 at 18:16 -0700, Ari wrote: > Unfortunately, the > solution wraps the result within another list, anyone know why? > Thanks. > > (defn collapse [data & keys-coll] > (if (map? data) > (for [[k v] data] > (collapse v (if (nil? keys-coll) > (conj [] k

Re: The Website / Wikispaces

2011-10-11 Thread mmwaikar
It has happened to me too a couple of times (I can't explain why, though). However, I've done "*pin as app tab*" for the clojure docs tab (this functionality is available in latest versions of Firefox), so even if I reopen FF, I don't get this problem often. -- You received this message becaus