Duplicate code in c.c.properties and c.c.java-utils

2010-10-01 Thread Shantanu Kumar
I found that the function read-properties is implemented in both c.c.properties and c.c.java-utils -- is this intentional? Which one is recommended, and why? Regards, Shantanu -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, sen

Re: Changing keys in a map

2010-10-01 Thread Sean Corfield
On Thu, Sep 30, 2010 at 11:54 PM, David Sletten wrote: > Sean, Sean...I was just making fun of your signature. :) Phew! Just checking... (I'm on some lists where the response to similar questions has been "You want me to do your homework?"...) -- Sean A Corfield -- (904) 302-SEAN Railo Technolo

Re: Macro Implementation: I Don't Understand This Error Message

2010-10-01 Thread Stefan Rohlfing
@Jürgen and Chris Thank you very much for helping me enlarge my understanding of macros! I realize that learning the subtleties of a macro implementation is not easy but well worth the effort. It is also quite interesting that a macro as it seems takes two implicit extra arguments. I am curious

Re: clojure-contrib 1.3.0-SNAPSHOT new combined targets

2010-10-01 Thread Sean Corfield
Excellent! Thanx for this! On Fri, Oct 1, 2010 at 2:20 PM, Stuart Sierra wrote: > Fixes to the build provided by Andreas Brenk, who has just mailed a > CA. > > You can now have a dependency on all modules in clojure-contrib with > the following dependency targets: > > Dependency on single, large

Re: relational data aggregation language

2010-10-01 Thread Ross Gayler
Thanks Daniel, That sounds like it's in the right direction (although that is probably true of anything that gives database-like functionality). I would need some filtered-join-like functionality between tables in order to select some of the rows of interest. As to the declarative part: leaving

Re: relational data aggregation language

2010-10-01 Thread Daniel Phelps
Hi Ross, I am working on something that may be of help to you, but it's very early in development. Basically I wanted to see if I could write a database server in Clojure and what I have now sounds (kinda) like what you're after. It was really simple. Imagine a list of maps as a database

Re: Screencast of the Emacs front end to the Clojure Debugging Toolkit:

2010-10-01 Thread Per Vognsen
That's some great work there, George! Are there any basic obstructions in the backend to doing expression-oriented rather than line-oriented breakpoints and stepping? -Per On Sat, Oct 2, 2010 at 3:32 AM, George Jahad wrote: > For your delectation: > http://www.vimeo.com/15462015 > > -- > You re

Re: Screencast of the Emacs front end to the Clojure Debugging Toolkit:

2010-10-01 Thread Phil Hagelberg
On Fri, Oct 1, 2010 at 1:32 PM, George Jahad wrote: > For your delectation: > http://www.vimeo.com/15462015 This is great; the ability to jump between Clojure and Java is really impressive. -Phil -- You received this message because you are subscribed to the Google Groups "Clojure" group. To p

Re: Calling macros by var

2010-10-01 Thread Phil Hagelberg
On Thu, Sep 30, 2010 at 11:09 PM, Konrad Hinsen wrote: > On 01.10.2010, at 03:07, Phil Hagelberg wrote: >> I suspect the answer may just be "yeah... that's not something you >> should do with macros", but I'm curious. I suppose the compiler only >> checks the :macro metadata when it's literally in

Re: Screencast of the Emacs front end to the Clojure Debugging Toolkit:

2010-10-01 Thread Tim Snyder
Fantastic work George! On Oct 1, 4:32 pm, George Jahad wrote: > For your delectation:http://www.vimeo.com/15462015 -- 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

relational data aggregation language

2010-10-01 Thread Ross Gayler
Hi, This is probably an abuse of the Clojure forum, but it is a bit Clojure-related and strikes me as the sort of thing that a bright, eclectic bunch of Clojure users might know about. (Plus I'm not really a software person, so I need all the help I can get.) I am looking at the possibility of fi

Re: Little LISPer and Ten Commandments

2010-10-01 Thread ax2groin
Yeah, it has been a good educational resource for working through. I'm not finished, but I've put the Clojure version of all the code up here: https://www.assembla.com/code/little_clojure/subversion/nodes Looking forward to those last couple chapters. msd -- You received this message because

Re: Screencast of the Emacs front end to the Clojure Debugging Toolkit:

2010-10-01 Thread Alan
I don't have time to watch the whole thing until I get home from work, but just hearing the first 30 seconds has me drooling all over myself... On Oct 1, 1:32 pm, George Jahad wrote: > For your delectation:http://www.vimeo.com/15462015 -- You received this message because you are subscribed to

Re: Clojure 1.3 alpha 1 report - bitwise operations extremely slow

2010-10-01 Thread ataggart
I'm working on the latter right now. Note there's already a ticket for the reflection problem: https://www.assembla.com/spaces/clojure/tickets/446 On Oct 1, 12:24 pm, Nicolas Oury wrote: > > David pointed out what should have been the obvious overhead (I'll > > blame it on being up at 2am), and

clojure-contrib 1.3.0-SNAPSHOT new combined targets

2010-10-01 Thread Stuart Sierra
Fixes to the build provided by Andreas Brenk, who has just mailed a CA. You can now have a dependency on all modules in clojure-contrib with the following dependency targets: Dependency on single, large JAR: groupId: org.clojure.contrib artifactId: standalone version: 1.3.0-SNAPSHO

Re: clojure-mode bug in Emacs

2010-10-01 Thread .Bill Smith
I see the problem with clojure-mode versions 1.5 and 1.7.1 (I haven't tried any others). I do not use paredit. > Not happening with the version i am using. > Do you use paredit? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Screencast of the Emacs front end to the Clojure Debugging Toolkit:

2010-10-01 Thread George Jahad
For your delectation: http://www.vimeo.com/15462015 -- 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.

Re: Clojure 1.3 alpha 1 report - bitwise operations extremely slow

2010-10-01 Thread Nicolas Oury
> David pointed out what should have been the obvious overhead (I'll > blame it on being up at 2am), and Nicolas pointed out the specific > problem. two solutions: - writing all combinations of unboxed/boxed for every function - having a more clever code generator that try to box every primiti

Re: Clojure 1.3 alpha 1 report - bitwise operations extremely slow

2010-10-01 Thread ataggart
David pointed out what should have been the obvious overhead (I'll blame it on being up at 2am), and Nicolas pointed out the specific problem. Compare: user=> (time (doseq [x (range 10)] (bit-shift-left x 1))) Reflection warning, NO_SOURCE_PATH:4 - call to shiftLeft can't be resolved. Reflect

Re: Problems Running tests with fixtures

2010-10-01 Thread Timothy Washington
Hmmm, I'm using clojure 1.2. I'll try out 1.3 when I get home. Thanks Tim On Thu, Sep 30, 2010 at 10:09 PM, Sean Corfield wrote: > On Thu, Sep 30, 2010 at 2:44 PM, Timothy Washington > wrote: > > Just in case anyone comes across this, I did get around it. In fig. 2 I > was > > trying to run (u

Re: Macro Implementation: I Don't Understand This Error Message

2010-10-01 Thread Chris Perkins
On Oct 1, 3:59 am, Stefan Rohlfing wrote: > I wanted to expand the 'infix' macro presented in chapter 7.3.1 of > 'Clojure in Action' to handle nested s-expressions: > > My first version did not work: > > (defmacro my-infix [expr] >   (if (coll? expr) >     (let [ [left op right] expr] >       (lis

Re: Idiomatic Way to Build String or Simply Use StringBuilder

2010-10-01 Thread Michael Gardner
On Sep 30, 2010, at 10:37 PM, HiHeelHottie wrote: > (ns test-test.parse > (:use [clojure.contrib.string :only (split)])) > > (defn parse-char [m c] > (condp = (:state m) > :degree (cond > (Character/isDigit c) (assoc m :degree (+ (* (:degree > m) 10) (Character/digit c 10)))

Re: Not sure if it's a bug or not

2010-10-01 Thread Laurent PETIT
2010/10/1 sailormoo...@gmail.com > Hi : > > In my web project the namespace is jinrou-clojure.army, > and the file is at jinrou-clojure/army.clj, > I guess your file is at jinrou_clojure/army.clj, and not jinrou-clojure/army.clj This is a known bug I reported two weeks ago, and has just been

Not sure if it's a bug or not

2010-10-01 Thread sailormoo...@gmail.com
Hi : In my web project the namespace is jinrou-clojure.army, and the file is at jinrou-clojure/army.clj, most the the classes are compiled to jinrou_clojure directory, but some files with name army$reify__3155.class are compiled into jinrou-clojure/army directory ( note: it's a - , not a

Re: Clojure 1.3 alpha 1 report - bitwise operations extremely slow

2010-10-01 Thread Nicolas Oury
There is no java definition for (Number, long) or (Number, int). As 1 is now a primitive, I think it cannot find any corresponding function. Strangely, putting 1M or (num 1) might be faster. Can someone try? On Fri, Oct 1, 2010 at 10:28 AM, David Powell wrote: > >> So, if it is true that rang

Re: anonymous fn or partial?

2010-10-01 Thread Ulises
> There is a subtle difference in how fixed arguments are handled. > partial evaluates the arguments only once while fn evaluates them on > each call. For side-effects free code the former can yield better > performance. To recap: Ah! What a nice caveat! (also applies to taking macros as arguments

Re: Macro Implementation: I Don't Understand This Error Message

2010-10-01 Thread Jürgen Hötzel
2010/10/1 Stefan Rohlfing : > Dear Clojure Group, > > I wanted to expand the 'infix' macro presented in chapter 7.3.1 of > 'Clojure in Action' to handle nested s-expressions: > > My first version did not work: > > (defmacro my-infix [expr] >  (if (coll? expr) >    (let [ [left op right] expr] >    

Re: anonymous fn or partial?

2010-10-01 Thread Simon Belak
There is a subtle difference in how fixed arguments are handled. partial evaluates the arguments only once while fn evaluates them on each call. For side-effects free code the former can yield better performance. To recap: (partial foo (baz 1 2)) == (let [b (baz 1 2)] (fn [& x] (apply foo b x)

Re: anonymous fn or partial?

2010-10-01 Thread André Thieme
Am 30.09.2010 13:46, schrieb Nicolas Oury: Note that you can't make readermacros yet. It's a supported in CL not in Clojure but maybe in future versions how knows. I meant, if you want to modify Clojure to allow a shorter notation for partial application, it is better to add a reader macro (dir

Re: Handling keystrokes

2010-10-01 Thread WoodHacker
This is a Clojure Java interop problem.If you are doing GUI programming with Swing in Clojure this is a real problem. The question is how do you subclass (?) a built-in swing operation to extend it to include your own code.After the paste, I want to do something to the pasted text.This

Re: Clojure 1.3 alpha 1 report - bitwise operations extremely slow

2010-10-01 Thread David Powell
> So, if it is true that range produces objects and dotimes produces > primitive longs, then I believe that it is the odd interaction between > bit-shift-left's inlining and long objects (as opposed to primitives) > that is causing the disparity in your measurements, not something > inherent in th

Re: Clojure 1.3 alpha 1 report - bitwise operations extremely slow

2010-10-01 Thread David Powell
On Fri 01/10/10 06:52 , Mark Engelberg mark.engelb...@gmail.com sent: > On Thu, Sep 30, 2010 at 9:13 PM, ataggart agg...@gmail.com> wrote:> As with > most microbenchmarks you're measuring > the test more than the> subject.  In the above case the seq > generation dominates.> > > Compare the foll

Re: disk-backed memoize?

2010-10-01 Thread Saul Hazledine
On Sep 18, 7:25 pm, David McNeil wrote: > >http://github.com/alienscience/cache-dot-clj > > Thanks for the link. That is helpful. > > > Would JDBC suit your needs as a storage medium? > > I suppose that would work, but I am thinking that an ehcache based > plugin forcache-dot-cljmight be a good so

Re: Clojure 1.3 alpha 1 report - bitwise operations extremely slow

2010-10-01 Thread ataggart
Yup, I'm wrong. According to the profiler (visualvm), doseq/bit-shift-left is spending over 80% of its time in clojure.lang.Reflector.getMethods, but any other combination (e.g., dotimes/bsl or doseq/+) doesn't spend any time there at all. For 100k iterations, the doseq/bsl hits getMethods just o

Macro Implementation: I Don't Understand This Error Message

2010-10-01 Thread Stefan Rohlfing
Dear Clojure Group, I wanted to expand the 'infix' macro presented in chapter 7.3.1 of 'Clojure in Action' to handle nested s-expressions: My first version did not work: (defmacro my-infix [expr] (if (coll? expr) (let [ [left op right] expr] (list op (my-infix left) (my-infix right))