Re: external clojure lib

2010-09-08 Thread Sean Corfield
On Tue, Sep 7, 2010 at 8:36 AM, Abraham vincent@gmail.com wrote: still i am not getting , i meant to say that , i want to use clojure.contrib. libraries , how to make it work with my system . from where this lib has to copied and which directory to copy... may be lib is clj's files One

Re: Documentation tools

2010-09-08 Thread Mark Engelberg
On Tue, Sep 7, 2010 at 10:23 PM, Sean Corfield seancorfi...@gmail.com wrote: I'm watching this thread and I'm wondering what kind of documentation people are talking about here. I've always been used to using self-documenting function / variable names and short comments for documenting

Strange Loop reminder...

2010-09-08 Thread Alex Miller
Hey all, I know everyone is excited about the first clojure-conj and I will be there myself! BUT, I would also like to draw your attention to the Strange Loop conference Oct 14-15th in St. Louis. Strange Loop will feature 8 talks on Clojure (http://strangeloop2010.com/tag/ Clojure ) as well as a

Re: RFC: updated c.c.logging with some breaking changes

2010-09-08 Thread ataggart
It's been in contrib's master branch for a while now. Here's the updated doc: http://clojure.github.com/clojure-contrib/branch-master/logging-api.html On Sep 7, 3:01 pm, ka sancha...@gmail.com wrote: These seem like good changes to me!  Any plans to push? -- You received this message because

Re: Documentation tools

2010-09-08 Thread Sean Corfield
On Tue, Sep 7, 2010 at 11:10 PM, Mark Engelberg mark.engelb...@gmail.com wrote: What pre-conditions need to be met by the inputs? What invariants are maintained by the function? What are the performance guarantees of the function? And this can't be expressed in a single sentence? Many times

Re: Documentation tools

2010-09-08 Thread Robert McIntyre
As a counterexample to these statements consider proxy, genclass, and it's ilk --- I don't think reading the source is good enough to totally understand the purpose behind those functions. There's also the issue of providing examples in the doc string. What's more clear, Associates a value

Re: Documentation tools

2010-09-08 Thread Mark Engelberg
On Wed, Sep 8, 2010 at 12:05 AM, Sean Corfield seancorfi...@gmail.com wrote: Most people who read my code have said it reads like poetry... Poetry takes a complex message and packs it into as few words as possible, resulting in something so cryptic and enigmatic that people bicker endlessly

Re: giws a window for people using c/c++ into clojure ..

2010-09-08 Thread Sunil S Nandihalli
just as a followup .. this is the solution I got from hoek when I reposted it on the irc (defn emit-giws-xml [c] (let [package (.getPackage c) methods (map #(hash-map :name (.getName %) :returnType (str (.getName (.getReturnType %)))

A difficult Metaphor for Macros (especially for Java people)

2010-09-08 Thread alux
Hello, I still try to read my way through Paul Grahams On Lisp, and always think how to motivate this stuff to my fellow Java people. How do I describe what it is all about in this Code is Data, and Macros let you grow your own language towards the problem stuff? [Why? Well, maybe I read to much

Re: A difficult Metaphor for Macros (especially for Java people)

2010-09-08 Thread Joop Kiefte
Actually, this metaphor has been used before. Check http://www.defmacro.org/ramblings/lisp.html for an other version of your story ;). 2010/9/8 alux alu...@googlemail.com: Hello, I still try to read my way through Paul Grahams On Lisp, and always think how to motivate this stuff to my fellow

Re: A difficult Metaphor for Macros (especially for Java people)

2010-09-08 Thread alux
Hello Joop, thanks for the link. So it seems not to be completely misled ;-) Greetings, alux On 8 Sep., 11:59, Joop Kiefte iko...@gmail.com wrote: Actually, this metaphor has been used before. Checkhttp://www.defmacro.org/ramblings/lisp.htmlfor an other version of your story ;). 2010/9/8

Re: clojure Image/video processing?

2010-09-08 Thread mac
Thank you Mark Downie for recommending OpenCL, I'll start playing around with it.  As for accessing the c libraries directly, I'm afraid I don't know much about JNI to do it from clojure.  Do you or anyone know of a good way to start with JNI in clojure? If you are going to use a straight C

Re: clojure.contrib.trace not working on 1.2?

2010-09-08 Thread Mark Nutter
I seem to recall that 1.2 is using chunked lazy sequences for performance reasons, and fib is a lazy sequence. I wonder if you'd start seeing intermediate steps using (fib 20) instead of (fib 3)? m On Tue, Sep 7, 2010 at 7:32 PM, Scott Jaderholm jaderh...@gmail.com wrote: Why does c.c.trace

Re: ANN: Indyvon - GUI library

2010-09-08 Thread Francesco Bellomi
Very interesting concept, thank you for sharing. Francesco On Sep 8, 3:39 am, Mikhail Kryshen mikh...@kryshen.net wrote: Hi, I have recently published Indyvon -- an experimental multithreaded GUI library for Clojure. The main idea behind the library is that base UI element (called layer)

Re: clojure.contrib.trace not working on 1.2?

2010-09-08 Thread Scott Jaderholm
On Wed, Sep 8, 2010 at 7:30 AM, Mark Nutter manutte...@gmail.com wrote: I seem to recall that 1.2 is using chunked lazy sequences for performance reasons, and fib is a lazy sequence. I wonder if you'd start seeing intermediate steps using (fib 20) instead of (fib 3)? This fib doesn't look lazy

Re: deftype makes no extender?

2010-09-08 Thread Stuart Halloway
The first rule of open dispatch club is you never get a complete list of club members. :-) This is also true for e.g. Java interfaces: there is no API call for reflectively show me all implementers of this interface. The IDE/tools use case is a real one, but it will need to be solved in the

Re: A difficult Metaphor for Macros (especially for Java people)

2010-09-08 Thread CuppoJava
I found the easiest way to introduce macros is just to introduce them as small syntactic sugaring. For example, getting rid of the explicit (fn [] ...) for macros like (with-open file ...). Once people get accustomed to this, they naturally extend it to more and more complicated usages. -Patrick

Re: A difficult Metaphor for Macros (especially for Java people)

2010-09-08 Thread alux
Hi Patrick, yes, I think thats the right way to teach this stuff. My problem arises earlier - I still have to motivate my collegues, to get them interested, and, maybe, teach them later ;-) Regards, alux On 8 Sep., 16:28, CuppoJava patrickli_2...@hotmail.com wrote: I found the easiest way to

Re: A difficult Metaphor for Macros (especially for Java people)

2010-09-08 Thread CuppoJava
Ah I see. Yes, motivation is hard. I don't have any good tips for that. I remember when I was trying to learn Lisp. Even though I desperately *wanted* to like Lisp, it still took a few tries before I started to appreciate it. Good luck! -Patrick On Sep 8, 11:07 am, alux alu...@googlemail.com

Re: A difficult Metaphor for Macros (especially for Java people)

2010-09-08 Thread Meikel Brandmeyer
Hi, On 8 Sep., 17:07, alux alu...@googlemail.com wrote: yes, I think thats the right way to teach this stuff. My problem arises earlier - I still have to motivate my collegues, to get them interested, and, maybe, teach them later ;-) Then I wouldn't stress macros at all. Just mention them

Re: deftype makes no extender?

2010-09-08 Thread alux
Hi Stu, I like your open dispatch club ;-) Yes, after some thinking this is rather clear - every single something had to be scanned whether it implements a protocol; ehm, and rescanned when a new protocol is defined. Well, I drop that request ;-) Thank you for the illumination, alux On 8

Re: A difficult Metaphor for Macros (especially for Java people)

2010-09-08 Thread alux
Hello Meikel, I agree with all the points you suggest to mention, and I do so. Nevertheless I will get (and got, so this is not hypothetic) the question: But why do they use this intolerable strange syntax? Why cant this be in a usual (C-like) syntax? And here (thats my state of understanding)

Re: A difficult Metaphor for Macros (especially for Java people)

2010-09-08 Thread lprefontaine
Hi, My main motivation to get away from Java as much as possible was the code size. I was tired of having to write tons of code lines for what I considered mundane things. Using wizards was not satisfactory to me. The generated code size is significant and still it has to be maintained either by

Strange bug with mutable fields and try

2010-09-08 Thread Nicolas Oury
Dear all, Clojure 1.2.0 (deftype A [ ^{:unsynchronized-mutable true} foo ] Object (hashCode [x] (set! foo :foo)

Re: A difficult Metaphor for Macros (especially for Java people)

2010-09-08 Thread Alan
This was actually the article that finally got me to overcome the inertia and start exploring lisp, as a long-time native Java speaker. I gave up again in a few weeks, but the possibilities excited me, and when I found Clojure I was delighted with the number of things that were better than lisp,

Re: Strange bug with mutable fields and try

2010-09-08 Thread Alan
Are you using the release version of 1.2.0? I get the behavior you describe when I use a snapshot of 1.2.0 from when I built from source, but when I use lein repl in a project with a dependency on 1.2.0, all three forms fail with the same exception. On Sep 8, 9:44 am, Nicolas Oury

Simple question about destructuring

2010-09-08 Thread Alan
I happened to be looking at the source for clojure.core/juxt, and I was a little surprised by the way it handles 4+ arguments -- 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

Re: Simple question about destructuring

2010-09-08 Thread Alan
Sorry, Google posted this before I was done. Anyway, it looks like: (defn juxt ([f g h fs] (let [fs (list* f g h fs)] ...))) Is there a reason to do that instead of the following? (defn juxt ([ fs] ...)) On Sep 8, 11:02 am, Alan a...@malloys.org wrote: I happened to be

Re: A difficult Metaphor for Macros (especially for Java people)

2010-09-08 Thread alux
Hello Luc, what you say is of course completely true. Nevertheless it seems true for Scala too. And now I come with a new language again. The curious people in my team (well, or its the one with enough spare time :) already had some look into Scala, and I think I need additional arguments make

Re: Simple question about destructuring

2010-09-08 Thread alux
Hi Alan, this is one of the places where clojure.core is not written in what I would called idiomatic Clojure. The reason is speed. Rich Hickey is very eager to speed up the libraries, and what you see in juxt is one of the verbose speedup tricks. Regards, alux On 8 Sep., 20:06, Alan

Re: A difficult Metaphor for Macros (especially for Java people)

2010-09-08 Thread lprefontaine
alux alu...@googlemail.com wrote .. Hello Luc, what you say is of course completely true. Nevertheless it seems true for Scala too. And now I come with a new language again. The curious people in my team (well, or its the one with enough spare time :) already had some look into Scala, and I

Standalone 1.2 contrib

2010-09-08 Thread Sean Devlin
Is there a monolithic standalone contrib jar out there? A download forget type of thing? -- 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: Standalone 1.2 contrib

2010-09-08 Thread Laurent PETIT
Hi, Have you followed the Download link from clojure.org ? 2010/9/8 Sean Devlin francoisdev...@gmail.com: Is there a monolithic standalone contrib jar out there?  A download forget type of thing? -- You received this message because you are subscribed to the Google Groups Clojure group.

Re: Standalone 1.2 contrib

2010-09-08 Thread Sean Devlin
Yep. It downloaded a zip file, which needed built. Maven broke. I really don't want to mess with maven right now. I just want a contrib JAR. On Sep 8, 3:22 pm, Laurent PETIT laurent.pe...@gmail.com wrote: Hi, Have you followed the Download link from clojure.org ? 2010/9/8 Sean Devlin

Re: Standalone 1.2 contrib

2010-09-08 Thread Laurent PETIT
look in the target/ dir of the zip ... 2010/9/8 Sean Devlin francoisdev...@gmail.com: Yep.  It downloaded a zip file, which needed built.  Maven broke.  I really don't want to mess with maven right now.  I just want a contrib JAR. On Sep 8, 3:22 pm, Laurent PETIT laurent.pe...@gmail.com

Re: Mapping a function to a map

2010-09-08 Thread Daniel Werner
On Sep 7, 9:00 am, Thomas thomas.g.kristen...@gmail.com wrote: I've also been using my own version of a map-to-values function extensively and it would be really nice to have something like that, either in contrib or in core. It comes in handy surprisingly often. +1 I find myself writing

Re: A difficult Metaphor for Macros (especially for Java people)

2010-09-08 Thread Mike Meyer
On Wed, 08 Sep 2010 15:13:57 -0400 (EDT) lprefonta...@softaddicts.ca wrote: I cannot help you much here. I looked at Scala nearly two years ago while searching for a JVM alternative to Java. I already knew Lisp and wanted a generic macro facility but I was not convinced by Scala even before

Re: matching with wild-cards in clojure multi-methods

2010-09-08 Thread Daniel Werner
On Sep 6, 4:43 pm, Meikel Brandmeyer m...@kotka.de wrote: You can use qualified keywords with an hierarchy. (def your-hierarchy   (- (make-hierarchy)     (derive ::hello ::anything)     (derive ::world ::anything)     (derive ::city ::anything)     (derive ::us ::anything))) Building your

$'s in java class member names and set!

2010-09-08 Thread Jon Seltzer
Suppose you have a class projects.test.A: package projects.test; public class A { public A(){super();} public boolean y; public boolean $z; } and I want to use set to update both values: user= (def m (A.)) ; Create a ref m to new instance of A #'user/m user= (set! (. m y) true)

Re: can't def m-bind because namespace

2010-09-08 Thread MohanR
So actually it looks like I need to understand type theory to understand this. Thanks, Mohan On Sep 7, 7:04 pm, Nicolas Oury nicolas.o...@gmail.com wrote: ...and report your findings here or blog somewhere if you don't mind :) I've been reading a lot about monads lately and can't get my

Re: A difficult Metaphor for Macros (especially for Java people)

2010-09-08 Thread Adam Burry
Rich does a fine job of explaining macros here: http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Rich-Hickey-and-Brian-Beckman-Inside-Clojure See minutes 23 to 25. The macro concept is not complicated, it should not be hard to explain to someone. The benefits of code writing code should

Re: A difficult Metaphor for Macros (especially for Java people)

2010-09-08 Thread Michael Ossareh
On Wed, Sep 8, 2010 at 08:17, CuppoJava patrickli_2...@hotmail.com wrote: Ah I see. Yes, motivation is hard. I don't have any good tips for that. I'm still a noob at the evangelising part of Lisp! However, when it comes to clojure, I tell Java people it's a better way of writing Java than

REPL

2010-09-08 Thread Sean
Hi, I'm new to Clojure. This is also my first time posting here. When I use REPL and print something out, I always get a nil printed. For example, (print Clojure), I got: clojurenil. Where does the nil come from? Thanks a lot! -- You received this message because you are subscribed to the

Re: Standalone 1.2 contrib

2010-09-08 Thread buckmeisterq
I felt the same way until I realized that downloading clojure straight from the web page was pretty much me doing it wrong or attempting to use the custom install that I wasn't ready to do yet (not knowing what I was doing). Leiningen is the easy way to get clojure, contrib, everything else,

Re: REPL

2010-09-08 Thread David Nolen
On Wed, Sep 8, 2010 at 2:26 PM, Sean stanleyzhang2...@gmail.com wrote: Hi, I'm new to Clojure. This is also my first time posting here. When I use REPL and print something out, I always get a nil printed. For example, (print Clojure), I got: clojurenil. Where does the nil come from?

Re: REPL

2010-09-08 Thread Mike Meyer
On Wed, 8 Sep 2010 11:26:38 -0700 (PDT) Sean stanleyzhang2...@gmail.com wrote: Hi, I'm new to Clojure. This is also my first time posting here. When I use REPL and print something out, I always get a nil printed. For example, (print Clojure), I got: clojurenil. Where does the nil come

Re: REPL

2010-09-08 Thread Alan
This. And to clarify, in case it's unclear: every function in Clojure must return a value - there are no void functions as in Java. print and println, therefore, in addition to printing their data, must return something (they choose nil), and the REPL always prints out the return value of whatever

[ANN] Leiningen 1.3.1

2010-09-08 Thread Phil Hagelberg
I'm pleased to announce the release of Leiningen 1.3.1. This release fixes a few key bugs and introduces a handful of minor features. Here are the highlights. Bug Fixes: * Performing a standalone install (a new feature of Leiningen 1.3.0) now pulls in all transitive dependencies. * Unreadable

Re: JSON lib of choice?

2010-09-08 Thread Richard Newman
The c.c.json lib was rewritten in January by Stuart Sierra to incorporate the missing features present in Dan Larkin's lib, and make it faster. This was when it switched from c.c.j.read/write to c.c.json. I switched to c.c.json around that time, and I've been happy with it as a

Re: [ANN] Leiningen 1.3.1

2010-09-08 Thread Sean Corfield
On Wed, Sep 8, 2010 at 2:05 PM, Phil Hagelberg p...@hagelb.org wrote: I'm pleased to announce the release of Leiningen 1.3.1. Thanx Phil! * repl task may be used outside the context of a project. Very useful! * Regexes may be used to specify namespaces in :aot list. Also very useful! --

Re: Standalone 1.2 contrib

2010-09-08 Thread Sean Devlin
Until you don't want to deal with maven, and just need a jar. Like if you're installing Enclojure just want the stupid jars. On Sep 8, 3:42 pm, buckmeist...@gmail.com wrote: I felt the same way until I realized that downloading clojure straight from the web page was pretty much me doing it

Re: $'s in java class member names and set!

2010-09-08 Thread Sean Devlin
Try using reflection to print out what the JVM thinks the field's name is. This might help. On Sep 8, 1:23 am, Jon Seltzer seltzer1...@gmail.com wrote: Suppose you have a class projects.test.A: package projects.test; public class A {   public A(){super();}   public boolean y;   public

Re: Standalone 1.2 contrib

2010-09-08 Thread Adrian Cuthbertson
I strongly support any initiative that does not assume maven is a given. -Rgds, Adrian. On Thu, Sep 9, 2010 at 5:03 AM, Sean Devlin francoisdev...@gmail.com wrote: Until you don't want to deal with maven, and just need a jar.  Like if you're installing Enclojure just want the stupid jars.

Re: Documentation tools

2010-09-08 Thread Phil Hagelberg
On Tue, Sep 7, 2010 at 11:10 PM, Mark Engelberg mark.engelb...@gmail.com wrote: Files: Many times there are dozens of functions that are interrelated.  Only one or two of them are the crucially important entry points that provide the high-level API.  The rest are mostly helper functions that

Re: Standalone 1.2 contrib

2010-09-08 Thread Phil Hagelberg
On Wed, Sep 8, 2010 at 12:38 PM, Sean Devlin francoisdev...@gmail.com wrote: Rich/Core This is WAY TOO MUCH WORK.  The first entries on the download page should be just .JARs, and then below that you could have the zip files you have now.  Also, the simple version should be bigger.  Here's the

Re: Standalone 1.2 contrib

2010-09-08 Thread Sean Corfield
I think Leiningen does a great job of hiding maven. I initially wanted to avoid Leiningen because of maven and when I was putting together cfmljure (as a way to introduce Clojure to CFML developers :) I initially documented the download ZIP, unzip, copy JARs approach but then I reconsidered and

Re: A difficult Metaphor for Macros (especially for Java people)

2010-09-08 Thread alux
Hello all, @Luc I'm not a OO adversary, but no evangelist too ;-) @Mike I think the difference between Scala and Clojure is not OO vs not OO, but rather static vs dynamic typing. Clojure is OO too, but as you see with Luc, you can ignore it ;-) @Adam Cool! A RH-video I want aware of! Thank you!

Re: matching with wild-cards in clojure multi-methods

2010-09-08 Thread Meikel Brandmeyer
Hi, On 8 Sep., 21:49, Daniel Werner daniel.d.wer...@googlemail.com wrote: Building your own hierarchy would make it safe to use unqualified keywords as well -- if I am not mistaken? (- (make-hierarchy) (derive :hello :anything) ...) derive works with non-qualified keywords, but the

Re: Standalone 1.2 contrib

2010-09-08 Thread Adrian Cuthbertson
Thanks Phil, the release jars address my concerns. Just to elaborate on Sean C's post, I think Leiningen is a great initiative - especially for those new to clojure/java, but for me it and maven are dissonant with my setup. From various comments on the list, I suspect there are others who have a