Re: Ironicly Maven2 is the lightest I could come up with

2009-04-01 Thread mikel
On Apr 2, 12:27 am, dysinger wrote: > Dogh!  Plz pardon my spelling. :D (embarrassed) > > On Apr 1, 7:25 pm, dysinger wrote: > > > > > ...for easy dependency management and no-compile project > > setup.https://github.com/dysinger/clojure-pom/tree > > > Using maven only for the dependency mana

Re: speed question

2009-04-01 Thread William D. Lipe
I did this: (defn draw [#^Canvas canvas] (let [#^BufferStrategy buffer (. canvas getBufferStrategy) #^Graphics g (. buffer getDrawGraphics)] (doseq [y (range 0 *height*)] (let [dy (- 1.5 (* 2.5 (/ y *height*)))] (doseq [x (range 0 *width*)] (let [dx (-

Re: Ironicly Maven2 is the lightest I could come up with

2009-04-01 Thread dysinger
Dogh! Plz pardon my spelling. :D (embarrassed) On Apr 1, 7:25 pm, dysinger wrote: > ...for easy dependency management and no-compile project > setup.https://github.com/dysinger/clojure-pom/tree > > Using maven only for the dependency management and to create a custom > repl script allows me to

Ironicly Maven2 is the lightest I could come up with

2009-04-01 Thread dysinger
...for easy dependency management and no-compile project setup. https://github.com/dysinger/clojure-pom/tree Using maven only for the dependency management and to create a custom repl script allows me to still use emacs/slime for dynamic development of clojure code. My motivation is 3 fold: 1)

Re: speed question

2009-04-01 Thread Dmitri
I'm running it as a script with: java -server -cp clojure.jar clojure.lang.Script mandelbrot.clj as I mentioned earlier, I did try forcing all the primitives, but didn't notice much of a difference, I also did try running the draw function repeatedly to make sure it wasn't just the startup times

Re: Questions about Clojure and Common Lisp

2009-04-01 Thread Adrian Cuthbertson
I have used Java and Jsp for many years as the platform for my business offerings. All new development is now being done in Clojure - I am comfortable (nay, delighted) with it's stability and viability. On Wed, Apr 1, 2009 at 6:12 PM, Jon Harrop wrote: > > On Wednesday 01 April 2009 16:51:49 Jo

Re: speed question

2009-04-01 Thread Dmitri
I'm running it as a script with: java -server -cp clojure.jar clojure.lang.Script mandelbrot.clj as I mentioned earlier, I did try forcing all the primitives, but didn't notice much of a difference, I did try running the draw method repeatedly to make sure it wasn't just the startup times causin

Re: speed question

2009-04-01 Thread Stuart Sierra
On Apr 1, 9:40 pm, Dmitri wrote: > I've been playing around with rendering a mandelbrot set, and using > pure java it renders about 2 seconds on my machine, however it runs > about 10 times as slow in clojure, I was curious if I'm doing anything > obviously wrong, or if it's just life :) I do run

Re: speed question

2009-04-01 Thread Dmitri
I actually tried forcing the type hints and didn't really see a noticeable improvement, just made the code hard to read for the most part. On Apr 1, 9:57 pm, CuppoJava wrote: > From a quick glance, I think the lack of type hints is what's slowing > down your Clojure code. > You can set the globa

Re: bound?

2009-04-01 Thread mikel
On Mar 26, 6:24 pm, mikel wrote: > How would you write bound? (defmacro bound? [nm & [the-ns]] `(let [nm-nsname# (namespace '~nm) the-ns# (if nm-nsname# (find-ns (symbol nm-nsname#)) (or ~the-ns ~clojure.core/*ns*)) nm# (symbol (name '~

Re: speed question

2009-04-01 Thread CuppoJava
>From a quick glance, I think the lack of type hints is what's slowing down your Clojure code. You can set the global variable *warn-on-reflection* to true, to get a sense of where to add your type hints. -Patrick --~--~-~--~~~---~--~~ You received this message be

Re: Setting up Clojure on OS X

2009-04-01 Thread Korny Sietsma
Good stuff - but I'm surprised you link to Phil Hagelberg's port of clojure-mode, but not to his emacs-starter-kit: http://github.com/technomancy/emacs-starter-kit/tree/master If you are going down the emacs path, but don't already have your own emacs setup, I highly recommend the starter kit -

speed question

2009-04-01 Thread Dmitri
I've been playing around with rendering a mandelbrot set, and using pure java it renders about 2 seconds on my machine, however it runs about 10 times as slow in clojure, I was curious if I'm doing anything obviously wrong, or if it's just life :) I do run it with the -server flag, which does impr

Re: basic question on structuring refs

2009-04-01 Thread Korny Sietsma
Thanks. I think the problem was I was assuming somehow I could keep track of my individual structures by some sort of object reference, independent of their position in the world - woolly object-oriented thinking - which was confusing me. If I instead have a key (or query function) that finds a s

Find the function you need

2009-04-01 Thread Mitch
While still learning clojure, I often times need a function and am not sure if it already exists or where to look for it. I thought it would be useful to be able to give a return value and arguments and search all functions for ones which return the given value when called with the given argument

Re: Full Clojure, Right Now! (tm)

2009-04-01 Thread Korny Sietsma
Emacs built with the emacs-starter-kit from http://github.com/technomancy/emacs-starter-kit/tree/master gets both clojure and clojure.contrib set up correctly. To use other jars, I had to hack the emacs-starter-kit stuff slightly; it seems that swank-clojure by default adds all jars in "~/.clojure

Re: I feel I'm making an elementary mistake with proxy, but I don't know what...

2009-04-01 Thread Luke VanderHart
Ugh, I hate it when I make a fool of myself and realize the answer to a question 1 minute after posting it, even when wrestling with it for an hour beforehand... The reason the example doesn't work is that the method is of a different arity than the one I'm attempting to call. Still doesn't expl

Re: Full Clojure, Right Now! (tm)

2009-04-01 Thread Raoul Duke
has the Clojure Box type of thing appeared for non-Windows systems? (googling says no.) --~--~-~--~~~---~--~~ 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 T

I feel I'm making an elementary mistake with proxy, but I don't know what...

2009-04-01 Thread levand
Isn't this supposed to work? (defn create-layout [] (proxy [java.awt.LayoutManager] [] (addLayoutComponent [name comp] (println "Called addLayoutComponent")) (removeLayoutComponent [comp] (println "Called removeLayoutComponent

Re: Full Clojure, Right Now! (tm)

2009-04-01 Thread e
i ended up bagging all IDE's for now and did this: http://en.wikibooks.org/wiki/Clojure_Programming/Getting_Started up through "Installing Clojure.contrib." my hardest part was getting rlwrap to compile on my mac. my macports environment is all messed up so I had to do some hacking (and probably

Re: Clojure Users Group - Denmark

2009-04-01 Thread fyuryu
Hi, I'm currently in Copenhagen so I'm definitely interested. -Roland --~--~-~--~~~---~--~~ 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 To unsubscribe fro

Re: Request for improved error reporting

2009-04-01 Thread Berlin Brown
On Apr 1, 3:23 pm, Vincent Foley wrote: > I have no experience with gradual typing, but I'd love to try it. It > seems there are many situations where dynamic typing just makes things > easier than in a language like Haskell, however I long for their > ability to verify correctness at compile

lazy-xml/emit does not pad deeply

2009-04-01 Thread philip.hazel...@gmail.com
Hi, user=> (use 'clojure.contrib.lazy-xml) nil user=> (emit '{:tag :foo :attrs {:a "b" :c "d"} :content ({:tag :bar :attrs {:e "f"} :content ({:tag :baz :attrs nil :content ("hello")})})} :pad true) hello nil The 'foo' element is getting the requested padding, but it does not propagate to th

Re: -> vs. comp

2009-04-01 Thread kkw
Thanks for the feedback everyone! Kev On Apr 1, 11:38 pm, Rayne wrote: > comp seems more appropriate here. > > On Mar 31, 11:52 pm, kkw wrote: > > > Hi folks, > > >     I have some code where I wanted to: > > - take a list of stuff (which includes another list inside) > > - use 'seq-utils/flat

Re: Clojure Users Group - Denmark

2009-04-01 Thread Christian Vest Hansen
On Wed, Apr 1, 2009 at 9:57 PM, Krukow wrote: > > > > On Apr 1, 8:16 pm, Lau_of_DK wrote: >> Keep me posted please, if this turns into something concrete > > Looks like we've got enough to get a user's group started -- great! > Seems most people are in cph, and I am in Aarhus :-(, but that shoul

Re: Full Clojure, Right Now! (tm)

2009-04-01 Thread Joshua Fox
For one example of how to set up libraries so they can find each other, Stuart Halloway's *Programming Clojure* has a sample code bundle at http://www.pragprog.com/titles/shcloj/source_code. This is arranged in directories and includes scripts for executing the code. Clojure contrib is there among

Re: Clojure Users Group - Denmark

2009-04-01 Thread Krukow
On Apr 1, 8:16 pm, Lau_of_DK wrote: > Keep me posted please, if this turns into something concrete Looks like we've got enough to get a user's group started -- great! Seems most people are in cph, and I am in Aarhus :-(, but that should be no problem. I know Rich was invited for JAOO at QCon

Re: Full Clojure, Right Now! (tm)

2009-04-01 Thread Meikel Brandmeyer
Hi, Am 01.04.2009 um 21:22 schrieb Daniel Jomphe: If my mileage is representative at all of most newcomer's experiences trying to get acquainted with clojure, this is very bad: all the following editors have a plugin for clojure, but none of them comes with an easy way to add clojure.contrib to

Re: test-is now supports TAP

2009-04-01 Thread Stuart Sierra
On Apr 1, 12:21 pm, Jason Sankey wrote: > Out of interest, are you interested in other output formats for test-is? >   I chose JUnit compatible as a defacto-standard -- it integrates with > the unofficial build server I have been working on as well as many other > tools.  I have it working but in

Re: Request for improved error reporting

2009-04-01 Thread Vincent Foley
I have no experience with gradual typing, but I'd love to try it. It seems there are many situations where dynamic typing just makes things easier than in a language like Haskell, however I long for their ability to verify correctness at compile time. Vince On Mar 29, 10:49 am, André Thieme wr

Full Clojure, Right Now! (tm)

2009-04-01 Thread Daniel Jomphe
Let's say I *hate* dealing with Java classpaths, especially within IDEs. Somehow, it's always the hardest configuration part of setting up a project. Let's add I want to use clojure + clojure.contrib. If my mileage is representative at all of most newcomer's experiences trying to get acquainted

Re: Clojure Users Group - Denmark

2009-04-01 Thread Lau_of_DK
On Mar 31, 1:00 pm, martin_clausen wrote: > I would certainly be interested. Lau are you out there ? > > /mac > Ping! Yea I'm out here - My activity on the Google Group is very limited, but an assembly at JAOO with Rich igniting would definitely be interesting - I would consider arranging a tr

Re: Request for improved error reporting

2009-04-01 Thread Mark Engelberg
On Wed, Apr 1, 2009 at 9:10 AM, hughw wrote: > I don't mind scrolling through the long stack crawl to discover where > my error is. but I do wish the initial error report could somehow give > me the information, rather thanrequiring the two step process (and > switching windows when using the sli

Re: A clojure server

2009-04-01 Thread christian
On Wed, Apr 01, 2009 at 05:27:55PM +0200, Konrad Hinsen wrote: > I haven't tried Christian's Clojure-specific server yet, but if it > solves that problem, I'll probably adopt it. > Sadly it doesn't. I could experiment with a custom classloader, though. For testing, such a server doesn't help

Re: test-is now supports TAP

2009-04-01 Thread Jason Sankey
Hi Stuart, Stuart Sierra wrote: > Not an April Fool's joke! New lib "clojure.contrib.test-is.tap" adds > Test Anything Protocol (TAP) support to test-is. Use it like this: > > ;; (use 'clojure.contrib.test-is) > ;; (use 'clojure.contrib.test-is.tap) > ;; > ;; (with-tap-output > ;;(ru

Re: Request for improved error reporting

2009-04-01 Thread hughw
On Apr 1, 10:53 am, hughw wrote: > I retract my comment! Although I agree with the sentiment that > improvederrorreportingwould be great, I'm unsure exactly what I > want. > Clarification: In the SLIME repl I invoke my function. It reports the error as java.lang.ClassCastException: java.lang

Re: Questions about Clojure and Common Lisp

2009-04-01 Thread Jon Harrop
On Wednesday 01 April 2009 16:51:49 Joshua Fox wrote: > > 3. Clojure can use Java libraries. Common Lisp can use C/C++ > > libraries. Is it possible to say Clojure has strong points to Common > > Lisp in the power of libraries? > > Accessing Java from Clojure is easier & more transparent than acce

test-is now supports TAP

2009-04-01 Thread Stuart Sierra
Not an April Fool's joke! New lib "clojure.contrib.test-is.tap" adds Test Anything Protocol (TAP) support to test-is. Use it like this: ;; (use 'clojure.contrib.test-is) ;; (use 'clojure.contrib.test-is.tap) ;; ;; (with-tap-output ;;(run-tests 'my.cool.library)) Warning: this doesn't

Re: Request for improved error reporting

2009-04-01 Thread hughw
On Apr 1, 10:43 am, hughw wrote: > On Mar 28, 8:24 pm, Stuart Sierra wrote: > [snip] > > > > > Also, if you're using SLIME, you lose line numbers every time you > > evaluate a form in the buffer.  Type > > (require your.namespace :reload) at the REPL to get them back. > > This advice did not w

Re: Questions about Clojure and Common Lisp

2009-04-01 Thread Joshua Fox
> 3. Clojure can use Java libraries. Common Lisp can use C/C++ > libraries. Is it possible to say Clojure has strong points to Common > Lisp in the power of libraries? Accessing Java from Clojure is easier & more transparent than accessing C from Common Lisp. Joshua On Wed, Apr 1, 2009 at 6:41 PM

Questions about Clojure and Common Lisp

2009-04-01 Thread Chanwoo Yoo
Hello. Yesterday, I talked with a representative of a publisher about a translation of Lisp books. There are books about Ruby, Lua, Erlang, and Groovy in South Korea, but there is no book about Lisp except SICP. So he is considering printing the first Lisp book in South Korea. We talked about 'Pro

Re: Questions about Clojure and Common Lisp

2009-04-01 Thread Jeffrey Straszheim
I can't give you any numbers on #2, but I have used both languages and there is no comparison. Groovy is freakishly slow. Clojure is relatively zippy. On Wed, Apr 1, 2009 at 11:41 AM, Chanwoo Yoo wrote: > > Hello. Yesterday, I talked with a representative of a publisher about > a translation o

Re: Request for improved error reporting

2009-04-01 Thread hughw
On Mar 28, 8:24 pm, Stuart Sierra wrote: [snip] > > Also, if you're using SLIME, you lose line numbers every time you > evaluate a form in the buffer. Type > (require your.namespace :reload) at the REPL to get them back. > This advice did not work for a situation I am encountering now and enc

Re: Possible Solution for Left-Right Precedence and More when using Multimethods? (was re: oo)

2009-04-01 Thread David Nolen
Very cool. On Wed, Apr 1, 2009 at 8:47 AM, Rich Hickey wrote: > > > I've added get-method (SVN 1338). > > (derive ::Circle ::Shape) > (derive ::Rect ::Shape) > > (defmulti area :Shape) > > ;note - you can name methods > (defmethod area ::Shape area-shape [x] nil) > > (get-method area ::Rect) > #

Re: A clojure server

2009-04-01 Thread Konrad Hinsen
On Apr 1, 2009, at 16:42, Victor Rodriguez wrote: > You might be interested in taking a look at nailgun: > http://www.martiansoftware.com/nailgun/index.html. I had tried nailgun a while ago, and still use it from time to time, but I found that for code development it has a significant disadv

Re: A clojure server

2009-04-01 Thread christian
On Wed, Apr 01, 2009 at 10:42:02AM -0400, Victor Rodriguez wrote: > > On Wed, Apr 1, 2009 at 8:28 AM, christ...@mvonessen.de > wrote: > > > > Hi, > > > > I wanted to use clojure for some scripting-like tasks (mostly > > experimenting with clojure's abilities). > > You might be interested in tak

Re: I need help tracking down a performance problem.

2009-04-01 Thread Vincent Foley
No change. I think made a small script that spends a large amount of time in java.lang.reflect.Array.setInt too: (set! *warn-on-reflection* true) (time (dotimes [_ 1] (let [#^ints arr (int-array 200)] (dotimes [i 200] (aset-int arr i i) So maybe I should try to see what

Re: Advanced Practical Recursion in Lisp 1.0

2009-04-01 Thread revoltingdevelopment
I like it, though I would prefer the more concise function "y" (lower case). --~--~-~--~~~---~--~~ 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 To unsubscr

Re: Interaction of macros and special forms

2009-04-01 Thread Konrad Hinsen
On Apr 1, 2009, at 16:28, Kevin Van Horn wrote: > But > >(def (wmd x {:a 1}) 37) > > gives me an error: "Second argument to def must be a Symbol". This > confuses me. Doesn't macro expansion happen entirely before > evaluation? So before the def special form is evaluated, (wmd x {:a > 1}) s

Re: A clojure server

2009-04-01 Thread Victor Rodriguez
On Wed, Apr 1, 2009 at 8:28 AM, christ...@mvonessen.de wrote: > > Hi, > > I wanted to use clojure for some scripting-like tasks (mostly > experimenting with clojure's abilities). You might be interested in taking a look at nailgun: http://www.martiansoftware.com/nailgun/index.html. For example,

Re: Possible Solution for Left-Right Precedence and More when using Multimethods? (was re: oo)

2009-04-01 Thread Konrad Hinsen
On Apr 1, 2009, at 14:47, Rich Hickey wrote: > I've added get-method (SVN 1338). Great, thanks! > Note how you can name methods for diagnostic purposes. This doesn't > introduce names into the namespace, just puts a name on the fn object. It's also useful for recursive calls, if you are sure y

Interaction of macros and special forms

2009-04-01 Thread Kevin Van Horn
I've been going through Stuart Halloway's book, _Programming Clojure_, and thinking about his deftarget macro has brought up some questions as to how macros and special forms interact in clojure. The deftarget macro needs to produce a "def" form that has metadata on its first argument, wh

A clojure server

2009-04-01 Thread christ...@mvonessen.de
Hi, I wanted to use clojure for some scripting-like tasks (mostly experimenting with clojure's abilities). But I found, that clojure's startup time is too bad to do that. So I implemented a client-server architecture which works pretty much like clojure's default clojure.main. I'd be glad if you

Re: Possible Solution for Left-Right Precedence and More when using Multimethods? (was re: oo)

2009-04-01 Thread Rich Hickey
On Mar 31, 12:45 pm, Konrad Hinsen wrote: > On Mar 31, 2009, at 16:32, Rich Hickey wrote: > > > Here are some problems/limitations of existing OO/GF systems that I > > don't intend to repeat: > > ... > > I agree that these are not desirable features. I have had to work > around some of them man

Re: -> vs. comp

2009-04-01 Thread Rayne
comp seems more appropriate here. On Mar 31, 11:52 pm, kkw wrote: > Hi folks, > >     I have some code where I wanted to: > - take a list of stuff (which includes another list inside) > - use 'seq-utils/flatten' to flatten the list > - use 'interpose' to add comma-delimiting strings between the

Re: -> vs. comp

2009-04-01 Thread Laurent PETIT
While we speak about function composition (or not), you can also use the partial function creator to obtain "point-free" (no need for anonymous function with formal argument declaration or use) code: And with the use of comp, you could define the function without even explicitly naming any formal

Re: Advanced Practical Recursion in Lisp 1.0

2009-04-01 Thread Remco van 't Veer
On Wed, Apr 1, 2009 at 12:00 PM, David Sletten wrote: > [snip] > I'm going to move forward with the negotiations, but I need to know > if you, the Clojure community, are on board here. Ultimately the > decision is going to come down to whether or not you find the APRiL > 1.0 technology useful. T

Re: basic question on structuring refs

2009-04-01 Thread Krukow
On Apr 1, 6:57 am, Korny Sietsma wrote: > I have a world that is a list of structures > > The world itself will change occasionally - i.e. I'll add or remove > structures from the overall list, and I'll regularly be reading the whole > list. > (C) both of the above - a ref for the "world" list w

Re: Clojure Users Group - Denmark

2009-04-01 Thread gammelgedden
Another Danish user here, I am in Copenhagen. I can only support the initiative but i dont think it will be possible to put so much effort into it. I am mostly a casual user, using clojure for ad hoc processing / conversion of various text file formats (like edifact, swift, xml ..) in connectio

Re: basic question on structuring refs

2009-04-01 Thread Rich Hickey
On Apr 1, 5:46 am, Christophe Grand wrote: > Hello Korny, > > I share your questioning. > > On 1 avr, 06:57, Korny Sietsma wrote: > > > (A) one ref for the whole world - in which case how do I stop parallel > > changes to two unrelated structures in the world from causing transaction > > retri

Re: Advanced Practical Recursion in Lisp 1.0

2009-04-01 Thread Paul Stadig
On Wed, Apr 1, 2009 at 6:00 AM, David Sletten wrote: > [snip] > > Here's 'length' again: > (((fn [m] > ((fn [future] >(m (fn [arg] > ((future future) arg > (fn [future] >(m (fn [arg] > ((future future) arg )) > (fn [rec] > (fn [l] >

Re: Clojure Users Group - Denmark

2009-04-01 Thread Krukow
On Mar 31, 11:33 pm, Attila Babo wrote: > Hey, here is another clojure user from Copenhagen. I'm a Hungarian but > living here so please count me in! Cool. I guess I will be arranging our first meeting at JAOO. Keep an eye on the site for other dcug news. -- Karl --~--~-~--~~-

Re: Setting up Clojure on OS X

2009-04-01 Thread Mark Reid
Just a quick note to say that I've added notes about the TextMate Clojure bundle to my tutorial. I've also put a concise version of the guide up on GitHub: http://github.com/mreid/clojure-framework/tree/master Regards, Mark. -- http://mark.reid.name --~--~-~--~~~

Advanced Practical Recursion in Lisp 1.0

2009-04-01 Thread David Sletten
Just last week I finally got my "Advanced Practical Recursion in Lisp 1.0" kit from Y-Combinator Technologies, Inc. (not Paul Graham's company). They have this amazing product that I think we can use in Clojure. I'm not supposed to share the source code, but I can trust you folks right? T

Re: basic question on structuring refs

2009-04-01 Thread Christophe Grand
Hello Korny, I share your questioning. On 1 avr, 06:57, Korny Sietsma wrote: > (A) one ref for the whole world - in which case how do I stop parallel > changes to two unrelated structures in the world from causing transaction > retries? In this case, I wonder whether to extend "ensure" so as t

Re: basic question on structuring refs

2009-04-01 Thread Adrian Cuthbertson
I came across a thread from Jul '08 which seems to be the definitive on handling side-effects within transactions - http://groups.google.co.za/group/clojure/browse_thread/thread/d645d77a8b51f01/667e833c1ea381d7 Adrian. On Wed, Apr 1, 2009 at 9:24 AM, Timothy Pratley wrote: > > Hi Korny, > > > T

Re: Possible Solution for Left-Right Precedence and More when using Multimethods? (was re: oo)

2009-04-01 Thread Konrad Hinsen
On 31.03.2009, at 21:48, Konrad Hinsen wrote: > On 31.03.2009, at 18:50, Mark Engelberg wrote: > >> On Tue, Mar 31, 2009 at 9:45 AM, Konrad Hinsen >> wrote: >>> I think this should be sufficient to cover all cases you mentioned, >>> but of course it needs to be tried in practice. >> >> I think y

Re: basic question on structuring refs

2009-04-01 Thread Timothy Pratley
Hi Korny, That is a very interesting question to me, specifically this part: > how do I stop parallel > changes to two unrelated structures in the world from causing transaction > retries? Actually I don't think you can ever rule out retries if you are using a ref (or atom) and more than one t