Re: Documentation tools

2010-09-08 Thread Sean Corfield
On Tue, Sep 7, 2010 at 11:10 PM, Mark Engelberg 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 there are dozens of f

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 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 about what subtle meanings

Re: JSON lib of choice?

2010-09-08 Thread Christian Vest Hansen
There are some performance numbers on different serialization libraries here: http://wiki.github.com/eishay/jvm-serializers/ Jackson is a Java JSON library and it seems to do pretty well in those benchmarks. On Tue, Sep 7, 2010 at 22:01, Michael Ossareh wrote: > > > On Mon, Sep 6, 2010 at 19:50,

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 %)))

Re: deftype makes no extender?

2010-09-08 Thread alux
Hello Stuart, sorry to answer so late, got holidays, happily. I tried to use the function extenders to list the implementations, so to say, of the protocol. That was playing around, not a use case taken from reality. If I try to make a use case up, hm, I may need it in the development environment,

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

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 : > 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

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 wrote: > Actually, this metaphor has been used before. > Checkhttp://www.defmacro.org/ramblings/lisp.htmlfor an other version of > your story ;). > > 2010/9/8 alux : > >

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

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 wrote: > Why does c.c.trace give different outpu

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 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") does not defi

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 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 to me so I don'

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 wrote: > I found the easiest way to introduce macros is just 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 wrote: > Hi Patrick, > >

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

2010-09-08 Thread Meikel Brandmeyer
Hi, On 8 Sep., 17:07, alux 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 later on - "Oh! And b

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 Se

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 h

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, as

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 wrote: > Dear a

Re: Strange bug with mutable fields and try

2010-09-08 Thread Nicolas Oury
On Wed, Sep 8, 2010 at 6:36 PM, Alan wrote: > 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 excepti

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 wrote: > I happened to be looking at the sou

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 the

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

2010-09-08 Thread alux
Hello Alan, yes, the map function. This is one of the places where you type until ypur fingers bleed in other languages. By the way, http://www.norvig.com/design-patterns/ seems to be a interesting read on the topic. I still havent read it (on the hotlist), but Norvig is said to show that a bunch

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 wrote: > S

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

2010-09-08 Thread lprefontaine
alux 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 think I need ad

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 : > 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

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 wrote: > Hi, > > Have you followed the Download link from clojure.org ? > > 2010/9/8 Sean Devlin : > > > Is there a mon

Re: Standalone 1.2 contrib

2010-09-08 Thread Laurent PETIT
look in the target/ dir of the zip ... 2010/9/8 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 wrote: >> Hi, >> >> Have you followed the Downl

Re: Mapping a function to a map

2010-09-08 Thread Daniel Werner
On Sep 7, 9:00 am, Thomas 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 functions like map-values and f

Re: Standalone 1.2 contrib

2010-09-08 Thread Sean Devlin
Laurent, Thank you for the specific help. 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 rough idea of what I mean Clojure C

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 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 own

$'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 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 head > > around it yet

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 b

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 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 Java; it gives you all the t

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 Goo

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 el

Re: REPL

2010-09-08 Thread David Nolen
On Wed, Sep 8, 2010 at 2:26 PM, Sean 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? > > Thanks a lot! > Try

Re: REPL

2010-09-08 Thread Mike Meyer
On Wed, 8 Sep 2010 11:26:38 -0700 (PDT) Sean 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? REPL stands for

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 whateve

[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 in

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 substitute.

Re: [ANN] Leiningen 1.3.1

2010-09-08 Thread Sean Corfield
On Wed, Sep 8, 2010 at 2:05 PM, Phil Hagelberg 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! -- Sean A Corfiel

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 i

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 wrote: > Suppose you have a class projects.test.A: > > package projects.test; > > public class A > { >   public A(){super();} >   public boolean y; >   public boolean $z; >

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 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. > > On Sep 8, 3:42 pm, bu

Re: Documentation tools

2010-09-08 Thread Phil Hagelberg
On Tue, Sep 7, 2010 at 11:10 PM, Mark Engelberg 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 > implement the lowe

Re: Standalone 1.2 contrib

2010-09-08 Thread Phil Hagelberg
On Wed, Sep 8, 2010 at 12:38 PM, Sean Devlin 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 > rough idea of what

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 upd

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 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 contract disallows that:

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 s

Re: Documentation tools

2010-09-08 Thread Sean Corfield
On Wed, Sep 8, 2010 at 1:18 AM, Mark Engelberg wrote: > I don't know that I'd be flattered by that comparison :) LOL. Point well taken :) > If you ever read an article presenting some new algorithm, data > structure, etc. in an academic journal, the published article will > certainly contain som

Re: Standalone 1.2 contrib

2010-09-08 Thread Sean Corfield
On Wed, Sep 8, 2010 at 10:56 PM, Adrian Cuthbertson wrote: > - A personal antipathy towards "bloat" and anything that "just gets > downloaded" without my fully understanding what it is and why it's > there. Yes, this is my main objection to maven and why I've resolutely stuck with ant and managin

Re: Documentation tools

2010-09-08 Thread Laurent PETIT
2010/9/9 Phil Hagelberg : > On Tue, Sep 7, 2010 at 11:10 PM, Mark Engelberg > 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 f

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

2010-09-08 Thread Sean Corfield
On Wed, Sep 8, 2010 at 7:28 AM, CuppoJava wrote: > 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 ...). Interesting. I don't see any real difference between

Re: Documentation tools

2010-09-08 Thread Mark Engelberg
On Wed, Sep 8, 2010 at 11:56 PM, Laurent PETIT wrote: >> Full ack here. > > For the non english speaker I am : is this a pun/playword ? (full ack > <-> f..ck all) ? I assume he meant "full acknowledgment" -- an expression of agreement. -- You received this message because you are subscribed to