Re: clojure vs scala

2009-08-26 Thread Timothy Pratley
My wish: There are easy-to-understand examples in API doc. From another thread I see that the api doc is being automated, so maybe this presents an opportunity to include a new meta tag such as :eg or :example (to allow them to be viewed separately from :doc - or if this is not a good idea

Re: clojure vs scala

2009-08-26 Thread Konrad Hinsen
On 26 Aug 2009, at 07:06, Vagif Verdi wrote: I fail to see how macros can be contrasted to static typeng. They are orthogonal. That is true in principle, but integrating Lisp-style macros and compulsory static typing (as opposed to optional type hints) into the same language does require

Re: advice needed about macro for proxy with argument

2009-08-26 Thread rb
On Aug 25, 9:54 pm, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am 25.08.2009 um 20:09 schrieb rb: Here is what I've done for now: (defmacro deflistener [ interfaces trigger-args body]  `(proxy [ ~...@interfaces ] [] (trigger [...@trigger-args] ~...@body)) ) Which can be used

Re: advice needed about macro for proxy with argument

2009-08-26 Thread rb
It takes as arguments * the list of interfaces it implements (currently necessary for http://www.assembla.com/spaces/clojure/tickets/181) ?? You always have to specify the interfaces, no? What I meant is that if I always implement SignalX$Listener, I could even get rid of the

Re: clojure vs scala

2009-08-26 Thread Michael Wood
2009/8/26 Konrad Hinsen konrad.hin...@fastmail.net: On 26 Aug 2009, at 07:06, Vagif Verdi wrote: [...] Here's and example of statically typed language (liskell) with lisp syntax and full blown lisp macros: http://blog.clemens.endorphin.org/2009/01/liskell-standalone.html ...this site is

Re: clojure vs scala

2009-08-26 Thread Christian Vest Hansen
On Tue, Aug 25, 2009 at 10:43 PM, npowellnathan.pow...@gmail.com wrote: On Aug 25, 4:36 pm, Christian Vest Hansen karmazi...@gmail.com wrote: I think he misrepresents both Scala and Clojure. ... Not a super helpful assessment. I'd like to hear more.  What do you disagree with and why?

Re: clojure vs scala

2009-08-26 Thread Sean Devlin
Quick aside: There is now a doc directory in contrib, specifically for usage docs. There should be more examples coming in the future. On Aug 26, 1:18 am, ngocdaothanh ngocdaoth...@gmail.com wrote: I think there are a lot of people who need to choose between Clojure and Scala to study as a

Re: duck-streams example?

2009-08-26 Thread Michael Kohl
On Tue, Aug 25, 2009 at 5:51 PM, Michael Kohlcitizen...@gmail.com wrote: The main problem is that I can't seem to figure out how to use duck-streams to achieve what I want... #clojure for the rescue. replaca pointed me to the documentation of clojure.contrib.http.agent which has a nice example

Re: clojure vs scala

2009-08-26 Thread Mark Volkmann
On Wed, Aug 26, 2009 at 12:18 AM, ngocdaothanhngocdaoth...@gmail.com wrote: I think there are a lot of people who need to choose between Clojure and Scala to study as a new language. I must say that both are bad: * Clojure doc is hard to understand. Have you seen

Re: ANN: clojure-contrib automatic documentation system complete

2009-08-26 Thread Rich Hickey
On Tue, Aug 25, 2009 at 4:39 PM, Tom Faulhabertomfaulha...@gmail.com wrote: Rich: Glad to help, thanks for the kind words. For Clojure core, mostly what I need to do is refactor and parameterize a bunch of stuff. I'll just make a fork and start playing. When I have something, we can

Re: clojure vs scala

2009-08-26 Thread ngocdaothanh
In the meantime this may be helpful: http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Example... Thank you, this is very helpful. * Clojure doc is hard to understand. Have you seen http://ociweb.com/mark/clojure/article.html? Yes I have, this may be the best Clojure doc on

Re: Jwt from Clojure?

2009-08-26 Thread rb
On Aug 17, 6:17 pm, Adrian Cuthbertson adrian.cuthbert...@gmail.com wrote: Hi Raphaël, If you're going to drive your app (and server) from clojure, then you can use Compojure's jetty.clj module. This allows you to create a Thanks Adiran for this information. It has allowed me to get it

Re: clojure vs scala

2009-08-26 Thread cody koeninger
On Aug 26, 5:29 am, Christian Vest Hansen karmazi...@gmail.com wrote: Another Scala downer: Scala is very powerful, some developers might shoot themselves into the foot - I don't see how this applies more to Scala than Clojure. If we want to talk about foot-shooting, we could talk about

Re: clojure vs scala

2009-08-26 Thread CuppoJava
I didn't find that article particularly helpful, especially since I was facing the exact same decision just a year ago. For me, the difficulty of the language was the ultimate criteria I made me go with Clojure. Relative to Scala, Clojure is quite a bit easier to pickup. It has less syntax

Re: Getting .NET Version of Clojure to run

2009-08-26 Thread Shawn Hoover
On Sat, Aug 15, 2009 at 8:36 AM, David Miller dmiller2...@gmail.com wrote: Clojure.Compile is just for AOT-compilation. It will compile whatever libs are on the command line. As you state, it is used to bootstrap, i.e. compile core.clj and the rest of the bootstap clojure code into

Re: we offer cheap sport shoes men's shoe(www.salegood8.com) casual shoe fashion shoe

2009-08-26 Thread John Harrop
On Tue, Aug 25, 2009 at 11:42 AM, Chouser chou...@gmail.com wrote: On Tue, Aug 25, 2009 at 10:36 AM, John Harropjharrop...@gmail.com wrote: What the hell? The group actually gets a steady stream of spam, but it usually gets deleted instead of being sent to everyone. On this one I

Re: On the reader macro #=

2009-08-26 Thread John Harrop
On Wed, Aug 26, 2009 at 1:13 PM, John Harrop jharrop...@gmail.com wrote: This is important to know about for security reasons, also. Specifically, if you are receiving Clojure data structures in text form over the network, and don't set *read-eval* to false, you're vulnerable to a Clojure

Re: On the reader macro #=

2009-08-26 Thread John Harrop
This is important to know about for security reasons, also. Specifically, if you are receiving Clojure data structures in text form over the network, and don't set *read-eval* to false, you're vulnerable to a Clojure injection attack. Someone could send you (+ 5 #=(System/exit 0)) as a

Re: clojure vs scala

2009-08-26 Thread Jon Harrop
On Wednesday 26 August 2009 08:35:49 Konrad Hinsen wrote: On 26 Aug 2009, at 07:06, Vagif Verdi wrote: I fail to see how macros can be contrasted to static typeng. They are orthogonal. That is true in principle, but integrating Lisp-style macros and compulsory static typing (as opposed to

Re: clojure vs scala

2009-08-26 Thread Jon Harrop
On Wednesday 26 August 2009 04:37:58 Alan Busby wrote: On Wed, Aug 26, 2009 at 5:43 AM, npowell nathan.pow...@gmail.com wrote: I mean, I didn't think the article was terribly in depth, but a real, evenhanded comparison would be enlightening. Reducing it further, I'd be interested just to

A little help needed in understnding anonymous functions

2009-08-26 Thread Sourav
Hi, I'm new to clojure and came from a Lisp background. While learning I clojure I came accross the two different ways of creating anonymous functions ((fn ...) and #(...)). I tried to construct the accumulator function in clojure using these forms and this is what I wrote (this might seem naive

Re: On the reader macro #=

2009-08-26 Thread Chouser
On Wed, Aug 26, 2009 at 1:13 PM, John Harropjharrop...@gmail.com wrote: This is important to know about for security reasons, also. Specifically, if you are receiving Clojure data structures in text form over the network, and don't set *read-eval* to false, you're vulnerable to a Clojure

Re: A little help needed in understnding anonymous functions

2009-08-26 Thread Meikel Brandmeyer
Hi, Am 26.08.2009 um 20:40 schrieb Sourav: (defn foo2 [n] (let [r (ref n)] #((dosync (alter r + %) @r One pair of parentheses too much... (defn foo2 [n] (let [r (ref n)] #(dosync (alter r + % What you wrote is #((foo)) which translates to (fn []

Re: clojure vs scala

2009-08-26 Thread Jon Harrop
On Tuesday 25 August 2009 21:43:56 npowell wrote: On Aug 25, 4:36 pm, Christian Vest Hansen karmazi...@gmail.com wrote: I think he misrepresents both Scala and Clojure. ... Not a super helpful assessment. I'd like to hear more. What do you disagree with and why? I think most of the

Re: A little help needed in understnding anonymous functions

2009-08-26 Thread Emeka
(defn foo2 [n] (let [r (ref n)] #(dosync (alter r + %) @r))) Something went wrong, I am resending the code. Regards, Emeka --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send

Re: A little help needed in understnding anonymous functions

2009-08-26 Thread Emeka
On Wed, Aug 26, 2009 at 6:40 PM, Sourav soura.ja...@gmail.com wrote: Hi, I'm new to clojure and came from a Lisp background. While learning I clojure I came accross the two different ways of creating anonymous functions ((fn ...) and #(...)). I tried to construct the accumulator function

Re: clojure vs scala

2009-08-26 Thread Mark Volkmann
On Wed, Aug 26, 2009 at 3:37 PM, Jon Harropj...@ffconsultancy.com wrote: What does Very clever immutable datastructures mean? How are Clojure's any more clever than the next implementation? My guess is that he was referring to how the data structures in Clojure are immutable and persistent

Re: How about write clojure code like python mode?

2009-08-26 Thread Stuart Sierra
On Aug 24, 11:23 pm, wangzx wangzaixi...@gmail.com wrote: I think clojure may mix both the parenthese and python-like indent together. This has been attempted about every six months ever since Lisp was invented. It never caught on. -SS --~--~-~--~~~---~--~~

Re: Getting .NET Version of Clojure to run

2009-08-26 Thread rodgertq
This can be done by MSBuild directly without involving an external tool like xcopy or robocopy using Item groups and built-in MSBuild tasks. We do this to deliver final artifacts in our build system. I should have some time in the next day or two to dig into the build for ClojureCLR, I will

Re: Getting .NET Version of Clojure to run

2009-08-26 Thread rodgertq
I'll also execute a CA and contribute back the require build script changes as well :) On Aug 26, 3:26 pm, rodgertq rodge...@gmail.com wrote: This can be done by MSBuild directly without involving an external tool like xcopy or robocopy using Item groups and built-in MSBuild tasks.  We do

Re: ANN: clojure-maven-plugin 1.0 released and in maven central

2009-08-26 Thread Rob Wolfe
ngocdaothanh napisał(a): I'm new to Maven. Thank you for the explanation. Using git-submodules and sourceDirectories is a good idea. Prior to using your plugin, I use clojure and clojure-contrib with Maven like this: 1. Manually download from GitHub and compile clojure and clojure-

Re: How about write clojure code like python mode?

2009-08-26 Thread Laurent PETIT
they didn't know it was impossible so they did it :) 2009/8/26 Stuart Sierra the.stuart.sie...@gmail.com On Aug 24, 11:23 pm, wangzx wangzaixi...@gmail.com wrote: I think clojure may mix both the parenthese and python-like indent together. This has been attempted about every six months

Why doesn't regex implement ifn?

2009-08-26 Thread Sean Devlin
Okay, I'm sure this has come up before. I was just wondering if anyone knew why the regex literal doesn't implement IFn? At first glance it seems like the following would be useful: user=(#\d{3} 123) true This is defined as... user=(not (nil? (re-matches #\d{3} 123))) true What am I missing?

Re: How about write clojure code like python mode?

2009-08-26 Thread Jonathan Smith
its not impossible, it just isn't terribly useful. On Aug 26, 6:04 pm, Laurent PETIT laurent.pe...@gmail.com wrote: they didn't know it was impossible so they did it :) 2009/8/26 Stuart Sierra the.stuart.sie...@gmail.com On Aug 24, 11:23 pm, wangzx wangzaixi...@gmail.com wrote: I

Re: Why doesn't regex implement ifn?

2009-08-26 Thread Chas Emerick
On Aug 26, 2009, at 9:17 PM, Sean Devlin wrote: Okay, I'm sure this has come up before. I was just wondering if anyone knew why the regex literal doesn't implement IFn? At first glance it seems like the following would be useful: user=(#\d{3} 123) true This is defined as... user=(not

Re: Newbie Eclipse REPL question

2009-08-26 Thread Seth.Powsner
On Aug 24, 12:22 pm, Laurent PETIT laurent.pe...@gmail.com wrote: There's a simpler way : just invoke Run as clojure REPL on the project node in the project explorer, and you will have a new Launch configuration created with the name of the project (and it will, obviously, be launched as

Re: Why doesn't regex implement ifn?

2009-08-26 Thread Timothy Pratley
java.util.regex.Pattern I imagine a wrapper class could be returned instead that implemented IFn and Pattern, but which function would it call? (re-find m) (re-find re s) (re-groups m) (re-matcher re s) (re-matches re s) (re-pattern s) (re-seq re s) I don't think there is a clear implicit

Re: Getting .NET Version of Clojure to run

2009-08-26 Thread David Miller
Having this in hand would be awesome. -David On Aug 26, 3:29 pm, rodgertq rodge...@gmail.com wrote: I'll also execute a CA and contribute back the require build script changes as well :) On Aug 26, 3:26 pm, rodgertq rodge...@gmail.com wrote: This can be done by MSBuild directly without

Re: Why doesn't regex implement ifn?

2009-08-26 Thread Chas Emerick
On Aug 26, 2009, at 9:46 PM, Timothy Pratley wrote: java.util.regex.Pattern I imagine a wrapper class could be returned instead that implemented IFn and Pattern, Pattern is a final concrete class, so that's not possible. ...I'm counting down until I see an all-clojure regex implementation

Re: clojure vs scala

2009-08-26 Thread e
On Wed, Aug 26, 2009 at 1:18 AM, ngocdaothanh ngocdaoth...@gmail.comwrote: I think there are a lot of people who need to choose between Clojure and Scala to study as a new language. I must say that both are bad: * Clojure doc is hard to understand. * Scala grammar is complicated. I prefer

Re: Why doesn't regex implement ifn?

2009-08-26 Thread Rich Hickey
On Aug 26, 9:46 pm, Timothy Pratley timothyprat...@gmail.com wrote: java.util.regex.Pattern I imagine a wrapper class could be returned instead that implemented IFn and Pattern, Unfortunately, Pattern is a final class. Rich --~--~-~--~~~---~--~~ You

Re: clojure vs scala

2009-08-26 Thread e
Listed as a downer for Scala: Functional programming can be difficult to understand for a Java developer - same can be said for Clojure, so I think it is a similarity but he presents it as a difference. Wow. All the more reason for a Java developer to mess with it then! After all, Java

Re: Why doesn't regex implement ifn?

2009-08-26 Thread Sean Devlin
Well, with a statically typed language this would be a problem. What if we used duck-typing to get around this? Granted, this wouldn't work for anything that gets passed to Java, but the following gist would be a start. http://gist.github.com/176032 Now, We'd still have to address Mr.

Re: clojure vs scala

2009-08-26 Thread e
For instance, after having read odersky's Scala book. . . if you like static typing and are looking for a new language, I don't see why you would choose Scala over Haskell unless you have a strong investment in java or really like the Lift web framework. Unrestricted use of vars, for

Connection pool with clojure.contrib.sql

2009-08-26 Thread ngocdaothanh
Hi. As I understand clojure.contrib.sql's with-connection opens DB connection at the beginning and closes it at the end of each call. How do I create a connection pool so that with-connection can reuse connections? Thanks, Ngoc. --~--~-~--~~~---~--~~ You

Re: Why doesn't regex implement ifn?

2009-08-26 Thread Timothy Pratley
Granted, this wouldn't work for anything that gets passed to Java, but the following gist would be a start. http://gist.github.com/176032 You already have a getPattern method for those cases. Which suggests another solution: (defn re-fn Uses ss to construct a java.util.Pattern. Returns a

Re: clojure vs scala

2009-08-26 Thread Luc Prefontaine
We looked at Scala in summer 2008... we were very tired of data typing in general and OOP (specifically Java). We did not find any comfort in Scala regarding these aspects. Concurrencent processing in Scala did not enthusiast us either. We wanted a significant code compression factor compared to