Re: a question about binding

2009-02-02 Thread Christophe Grand
Eric a écrit : > He said that I should use clojure.core/list instead of #'list. That > is, to reference it with a fully-qualified name. But my understanding > is that binding still changes clojure.core/list withing the binding > form. Here, from my REPL: > > (let [list 10] > (binding [list +]

Re: a question about binding

2009-02-02 Thread Christophe Grand
Stephen C. Gilardi a écrit : > Here are some suggestions of mine. I don't claim they're standard: > > - Avoid using an argument name or let-bound local name that > "shadows" the (unqualified) name of a var you need to use within its > scope > - Failing that, use a namespace qualified sym

Re: Questions about a Clojure Datalog

2009-02-02 Thread Timothy Pratley
Hi Jeffrey, On Feb 1, 4:50 am, Jeffrey Straszheim wrote: > However, I'm not sure if you can built your own predicates in Java > code (and therefore in Clojure code).  That seems like a feature we'd > want.  I've sent an email to their support folks to find out if this > is possible. I gave it a

Re: CLJOS -> Spinoza, 3X faster than struct-map ;)

2009-02-02 Thread David Nolen
Just to be clear make-instance is a macro on struct: (defmacro make-instance "Takes a defclassed struct-basis and creates a struct. Initializes properties to default values." [aclass & initializers] (let [class-key (eval (make-pair aclass)) class-sym (symbol (name aclass))

Clojure, GUI and NetBeans (a short guide on line and for download)

2009-02-02 Thread prhlava
Hello, In an attempt of returnig favour (i.e. being able to use so much good free software and getting free help while doing so), I have put together a short guide (very basic) on how to use NetBeans GUI (Swing) designer and then get hands on it from Clojure. The guide is available in 2 forms (

User Map

2009-02-02 Thread Meikel Brandmeyer
Dear Clojurians, the questions of the various locations, which were recently posted, reminded me of Graham Fawcett's Clojure User Map. Feel free to add your pin and look for fellows in your area. http://maps.google.com/maps/ms?ie=UTF&msa=0&msid=112691912540601337884.00045972a1deb8de0d96b Sincer

Memory Consumption of Large Sequences

2009-02-02 Thread Keith Bennett
All - I'm curious to know how to minimize memory consumption in Clojure for large lists. I did the following test in repl: (def d ()) (dotimes [_ 10] (def d (cons "x" d))) Then, I used VisualVM, an awesome free profiling tool (https:// visualvm.dev.java.net/) to examine the results. It in

Clojure speed

2009-02-02 Thread Gregory Petrosyan
Hello everybody, Althrough I am new to Clojure, I like it a lot. Because it is advertised as native JVM language, I expected it to demostrate decent performance in simple numeric tests, so I decided to compare it to Python. Clojure rev. 1173: user=> (defn fac [#^Integer n] (reduce * (range 1 (+

Re: Clojure speed

2009-02-02 Thread Konrad Hinsen
On 02.02.2009, at 16:35, Gregory Petrosyan wrote: > Althrough I am new to Clojure, I like it a lot. Because it is > advertised as native JVM language, I expected it to demostrate decent > performance in simple numeric tests, so I decided to compare it to > Python. > > Clojure rev. 1173: > user=>

Re: Memory Consumption of Large Sequences

2009-02-02 Thread Paul Barry
Ketih, I think what you have done, at least at the JVM level, is create 100,000 lists, with basically each list containing an element and a pointer to the next element. Because one list points to the next, none of them can be garbage collected. It seems to me that this would be roughly equivalen

A short guide on how to use NetBeans to create GUI and then use this GUI from clojure available

2009-02-02 Thread prhlava
Hello, I have put a short guide on how to create Swing GUI using NetBenans and how to get hands on this generated GUI JForm (java class) from clojure. I hope someone will find this useful... http://www.dearm.co.uk/cgan/ or (.pdf version): http://www.dearm.co.uk/cgan/cgan.pdf Vlad PS: Comme

Re: Memory Consumption of Large Sequences

2009-02-02 Thread Christian Vest Hansen
The trick with these listish things is to not calculate the tail until you need it, and to throw away the head when you're done with it. On Mon, Feb 2, 2009 at 7:06 PM, Keith Bennett wrote: > > All - > > I'm curious to know how to minimize memory consumption in Clojure for > large lists. I did

Re: Questions about a Clojure Datalog

2009-02-02 Thread Jeffrey Straszheim
It would have been nice if that link was prominent on their website. They still haven't responded to the email I sent them. On Feb 2, 10:13 am, Timothy Pratley wrote: > Just thought I'd share this > link:http://www.murat-knecht.de/schuerfen/irisdoc/html-single/index.html > Particularly Example

SVN branches

2009-02-02 Thread MikeM
There is a "lazy" branch in SVN. The "streams" branch has been discussed, but I haven't seen any discussion of the "lazy" branch - perhaps I missed it. Rich and/or other contributors if you have a little time - I'm curious what changes are being considered and when these might show up in trunk. Al

Re: A short guide on how to use NetBeans to create GUI and then use this GUI from clojure available

2009-02-02 Thread hubritic
Looks like I'll find it helpful. Thanks! On Feb 2, 10:42 am, prhlava wrote: > Hello, > > I have put a short guide on how to create Swing GUI using NetBenans > and how to get hands on this generated > GUI JForm (java class) from clojure. > > I hope someone will find this useful... > > http://www.

Re: Will Clojure work on AppEngine?

2009-02-02 Thread Robin
I am not an expert on the JVM, but I think Google's runtime will disallow uploading precompiled bytecode (jar). The assumption is that if you can compile it on their servers, then it is legal and therefore safe. I hope they allow the use of ASM library. Obviously this is speculation, but can you

Re: SVN branches

2009-02-02 Thread Chouser
On Mon, Feb 2, 2009 at 2:05 PM, MikeM wrote: > > There is a "lazy" branch in SVN. The "streams" branch has been > discussed, but I haven't seen any discussion of the "lazy" branch - > perhaps I missed it. Here's a discussion from earlier today, mainly about the "lazy" branch: http://clojure-log

Re: Clojure speed

2009-02-02 Thread David Nolen
Heh, this is a more reasoned reply than my own as it points out an actual implementation difference between Python and Clojure. And of course you might need arbitrary precision arithmetic in your program, but again this just reinforces the insignificance of microbenchmarks without some context of w

Re: Will Clojure work on AppEngine?

2009-02-02 Thread Mark Derricutt
I wonder if the Classloader issues that currently affect OSGi would impact an app-engine style deployment scenario as well. My understanding of the issue is that each different classloader would pick up its own RT and compile/generate up different versions of the core classes under each classloade

Re: A short guide on how to use NetBeans to create GUI and then use this GUI from clojure available

2009-02-02 Thread prhlava
Cool, at least one positive response so far :-). I have also put the .pdf file into this group's files section, called: clojure-gui-and-netbeans.pdf Vlad --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure"

Re: CLJOS -> Spinoza, 3X faster than struct-map ;)

2009-02-02 Thread Mark Volkmann
On Mon, Feb 2, 2009 at 11:10 AM, David Nolen wrote: > Just to be clear make-instance is a macro on struct: Ah! That wasn't clear to be before. I thought you were making a case for plain maps being more efficient than struct-maps. -- R. Mark Volkmann Object Computing, Inc. --~--~-~--~-

Re: User Map

2009-02-02 Thread Mark Volkmann
On Mon, Feb 2, 2009 at 12:02 PM, Meikel Brandmeyer wrote: > Dear Clojurians, > > the questions of the various locations, which were recently > posted, reminded me of Graham Fawcett's Clojure User Map. > Feel free to add your pin and look for fellows in your area. > > http://maps.google.com/maps/m

Re: User Map

2009-02-02 Thread Meikel Brandmeyer
Hi Mark, Am 02.02.2009 um 21:42 schrieb Mark Volkmann: http://maps.google.com/maps/ms?ie=UTF&msa=0&msid=112691912540601337884.00045972a1deb8de0d96b How do you add a pin? You have to be logged in with your google account. Then you have an edit button on the left hand side. Clicking on that gi

Re: User Map

2009-02-02 Thread Robert Lally
Thanks Meikel, that's the answer. R. 2009/2/2 Meikel Brandmeyer > Hi Mark, > > Am 02.02.2009 um 21:42 schrieb Mark Volkmann: > >> >>> http://maps.google.com/maps/ms?ie=UTF&msa=0&msid=112691912540601337884.00045972a1deb8de0d96b >>> >> >> How do you add a pin? >> > > You have to be logged in with

Re: Memory Consumption of Large Sequences

2009-02-02 Thread Keith Bennett
On Feb 2, 1:41 pm, Paul Barry wrote: > Ketih, > > I think what you have done, at least at the JVM level, is create 100,000 > lists, with basically each list containing an element and a pointer to the > next element.  Because one list points to the next, none of them can be > garbage collected.

Re: Memory Consumption of Large Sequences

2009-02-02 Thread Keith Bennett
Paul - Clojure definitely has its benefits, but in terms of memory footprint, Java appears to be *much* more economical, unless elements can be discarded shortly after use as Christian describes, in which case it's much *less* economical. In a Java ArrayList, only a single ArrayList object is us

Re: A short guide on how to use NetBeans to create GUI and then use this GUI from clojure available

2009-02-02 Thread AlamedaMike
As it happens, I just downloaded NetBeans a few hours ago to start working on this very issue. Thanks for saving me the trouble! Also, Nokia has just changed the licensing of Qt Jambi so that LGPL can be used. My sense is that Qt looks nicer than Swing, though I'd be happy to hear if otherwise if

Re: Clojure speed

2009-02-02 Thread David Nolen
Please do the list a favor and read the very long threads about performance. You cannot expect to enter a new language run a microbenchmark you would never see in a running programming and expect that to be anything like a real comparison. Here's something unlikely but far less so (something like

clojure-contrib basic questions

2009-02-02 Thread GS
Hi, There are three "homes" for clojure-contrib that I've seen referred to on the web (each in more than one place): Google Code Sourceforge git://github.com/kevinoneill/clojure-contrib.git Now I think I've got a pretty good idea which one is the correct one, but how did this situation co

Re: London Clojurians

2009-02-02 Thread verec
Count me in :) -- JFB --~--~-~--~~~---~--~~ 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 from this group, send email to clojure+unsubscr...@g

Re: CLJOS -> Spinoza, 3X faster than struct-map ;)

2009-02-02 Thread Zak Wilson
In your example, why are you using struct-map to create your structs instead of just using struct? (struct rect-struct ::rect [50 50] 100 190) produces the same struct, but is about three times faster than using struct-map. (time (dotimes [x 100] (struct-map rect-struct :tag ::rect

Re: User Map

2009-02-02 Thread Robert Lally
Just so you don't feel alone Mark, I can't figure it out either. Rob Lally. 2009/2/2 Mark Volkmann > > On Mon, Feb 2, 2009 at 12:02 PM, Meikel Brandmeyer wrote: > > Dear Clojurians, > > > > the questions of the various locations, which were recently > > posted, reminded me of Graham Fawcett'

Re: CLJOS -> Spinoza, 3X faster than struct-map ;)

2009-02-02 Thread David Nolen
Hey, it is an extremely simplified example ;) Which is more readable in the long run? (struct sprite ::foobar 98 ::hunta ::laser [5.5 3.3] 4.01 78) or (make-instance foobar :id 98 :mode ::hunta :weapon ::laser

London Clojurians

2009-02-02 Thread Tom Ayerst
Hi, Is there anyone getting together in London to discuss Clojure? If so, can anyone play? If not, would anyone be interested? Cheers Tom --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post

Re: what does -> mean?

2009-02-02 Thread wubbie
any concrete example? thanks, -sun On Feb 2, 5:13 am, Christian Vest Hansen wrote: > On Sun, Feb 1, 2009 at 9:35 PM, e wrote: > > This may be obvious to others, but what's the motivation behind it?  Is it > > that we are very concerned about combatting the criticism that lisp has too > > many

Re: what does -> mean?

2009-02-02 Thread Mark Volkmann
On Mon, Feb 2, 2009 at 6:34 AM, wubbie wrote: > > any concrete example? Here's an example of how -> makes it easy to get data out of nested maps. (def person { :name "Mark Volkmann" :address { :street "644 Glen Summit" :city "St. Charles" :state "Missouri" :zip 63304} :emp

Re: A short guide on how to use NetBeans to create GUI and then use this GUI from clojure available

2009-02-02 Thread Timothy Pratley
Hi Vlad, A very useful guide. > PS: Comments welcome... Ok great, let me nitpick! :) The java class you posted doesn't compile (unless name is renamed person_name, and location renamed person_location). The quote symbol rendered is not copy+paste friendly. You can call main very easily: (MainF

Re: clojure-contrib basic questions

2009-02-02 Thread Michael Wood
On Mon, Feb 2, 2009 at 3:00 PM, GS wrote: > > Hi, > > There are three "homes" for clojure-contrib that I've seen referred to > on the web (each in more than one place): > > Google Code > Sourceforge > git://github.com/kevinoneill/clojure-contrib.git > > Now I think I've got a pretty good idea

Re: Memory Consumption of Large Sequences

2009-02-02 Thread Chouser
On Mon, Feb 2, 2009 at 4:48 PM, Keith Bennett wrote: > > Clojure definitely has its benefits, but in terms of memory footprint, > Java appears to be *much* more economical It's probably worth being careful to separate the different parts of Java and Clojure. Clojure code can use most Java data

Re: Amsterdam.clj

2009-02-02 Thread Jeff Rose
Oh, cool! I'll be at the library next Monday then. Thanks for letting me know. -Jeff Remco van 't Veer wrote: > Great idea! Maybe you would like to join ACK: > > > http://groups.google.com/group/amsterdam-rb/browse_thread/thread/2a38b6b85f3e7bbb > > A small get together initiated by Rubyi

Re: London Clojurians

2009-02-02 Thread James Reeves
On Feb 2, 9:37 am, Tom Ayerst wrote: > Is there anyone getting together in London to discuss Clojure? >   If so, can anyone play? >   If not, would anyone be interested? I'm in London, and I might be interested. I tend to have a pretty tight schedule, though :( - James --~--~-~--~~-

Re: what does -> mean?

2009-02-02 Thread Christian Vest Hansen
On Mon, Feb 2, 2009 at 1:34 PM, wubbie wrote: > > any concrete example? http://github.com/karmazilla/textjure/blob/cf4ac457358e02f1d1d46d14a2885da0544dbd46/textjure.clj#L342 > > thanks, > -sun > > > On Feb 2, 5:13 am, Christian Vest Hansen wrote: >> On Sun, Feb 1, 2009 at 9:35 PM, e wrote: >>

Re: Questions about a Clojure Datalog

2009-02-02 Thread Timothy Pratley
Just thought I'd share this link: http://www.murat-knecht.de/schuerfen/irisdoc/html-single/index.html Particularly Examples 1.2 and 1.6 show how the parts fit together. I really wish I saw that before attempting anything :) Well now I know for next time. --~--~-~--~~~--

Re: Memory Consumption of Large Sequences

2009-02-02 Thread Mark H.
On Feb 2, 10:06 am, Keith Bennett wrote: > I'm curious to know how to minimize memory consumption in Clojure for > large lists.  I did the following test in repl: > > (def d ()) > (dotimes [_ 10] (def d (cons "x" d))) Let me translate this into pseudocode for you: Make d into a global refer

Re: London Clojurians

2009-02-02 Thread prhlava
Hello Tom, > If not, would anyone be interested? I live in London and would be interested... Vlad --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@goo

Re: what does -> mean?

2009-02-02 Thread Christian Vest Hansen
On Sun, Feb 1, 2009 at 9:35 PM, e wrote: > This may be obvious to others, but what's the motivation behind it? Is it > that we are very concerned about combatting the criticism that lisp has too > many parens? The -> macro is simply an excellent tool for drilling into nested structures and/or p

Re: CLJOS -> Spinoza, 3X faster than struct-map ;)

2009-02-02 Thread Mark Volkmann
On Sun, Feb 1, 2009 at 7:22 PM, David Nolen wrote: > I've changed the name of my project since that was a joke anyway. > http://github.com/swannodette/spinoza/tree/master > > Spinoza isn't just for people who want object oriented behaviors. It's also > for anyone who plans on instantiating many

Re: Amsterdam.clj

2009-02-02 Thread Remco van 't Veer
Great idea! Maybe you would like to join ACK: http://groups.google.com/group/amsterdam-rb/browse_thread/thread/2a38b6b85f3e7bbb A small get together initiated by Rubyist in Amsterdam. Next meeting is next monday. At least two of us, myself included, are happily hacking clojure. On Mon, Fe

Amsterdam.clj

2009-02-02 Thread Jeff Rose
Anyone else hacking Clojure in Amsterdam? How about going for a beer and talking some shop? -Jeff --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googl

Re: Clojure speed

2009-02-02 Thread Christian Vest Hansen
It is safe to assume that Python uses the GMP library for its infinite precision math, no? This could be a big part of the explanation as, if the language shootouts are to be believed, BigInteger and BigDecimal have inferior performance when compared to what can be achieved with GMP. For problems

Re: Memory Consumption of Large Sequences

2009-02-02 Thread Luc Prefontaine
Paul, I can understand the concerns about memory footprint if you work in a restricted environment (lack of physical memory or other system resources) or if your memory load is very high. However, these things are less common these days with the kind of hardware we can buy compared to what we cou

Santiago Clojurians?

2009-02-02 Thread blackdog
Hi If there's anyone in Santiago, Chile, who speaks Clojure and some English (my Spanish is not very good) would be good to meet up. Cheers bd -- None are more hopelessly enslaved than those who falsely believe they are free — Goethe --~--~-~--~~~---~--~

Re: Memory Consumption of Large Sequences

2009-02-02 Thread Keith Bennett
Luc - It is I (Keith) who posed the original question. I am just now learning Clojure, and for me, understanding what's going on underneath the surface helps me understand how to use the language properly. As I said previously, the amount of memory consumed by a list will very rarely be an issu

Re: Santiago Clojurians?

2009-02-02 Thread Jon Harrop
On Tuesday 03 February 2009 00:39:45 blackdog wrote: > Hi > > If there's anyone in Santiago, Chile, who speaks Clojure and some > English (my Spanish is not very good) would be good to meet up. Perhaps a Venn diagram would help. ;-) -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffco

special forms vs. functions and macros

2009-02-02 Thread Mark Volkmann
I understand that special forms are all recognized by the Clojure compiler clojure.lang.Compiler. Is it the case that all function and macro definitions can be found in some .clj file, whether supplied with Clojure or not? Asked another way, are there any functions or macros that are included with

Re: Santiago Clojurians?

2009-02-02 Thread blackdog
On Tue, 3 Feb 2009 01:53:36 + Jon Harrop wrote: > > On Tuesday 03 February 2009 00:39:45 blackdog wrote: > > Hi > > > > If there's anyone in Santiago, Chile, who speaks Clojure and some > > English (my Spanish is not very good) would be good to meet up. > > Perhaps a Venn diagram would hel

Re: special forms vs. functions and macros

2009-02-02 Thread David Nolen
I think the special forms list on the Clojure main page lists all the constructs that are not written in Clojure itself. It seems most everything else can be found in the .clj files in the src directory. I'm constantly looking in there when I'm curious how something works or is implemented, espec

Re: special forms vs. functions and macros

2009-02-02 Thread Jason Wolfe
I believe that any non-special-form has a clojure implementation in some .clj file, although that implementation may simply be a wrapper for a method in clojure.lang.RT. Also check out the source macro in clojure.contrib.repl_utils. It's quite nifty: user> (source into) (defn into "Returns a

Possible to create a much larger "world" than ants.clj?

2009-02-02 Thread canadaduane
I have a project where I would like to have a much larger world than the 80x80 world in Rich's ants.clj [1] demo. When I bring the world up past about 600x600, I get a java.lang.OutOfMemoryError. Is this expected? If so, is there another reasonable way to represent a large grid with concurrent

need some help getting jacob com library to work

2009-02-02 Thread greg
I have recently enjoyed exploring clojure. I can use java... C:\myprograms\clojure>java -cp clojure.jar clojure.lang.Repl Clojure user=> (into [] (.list (new java.io.File "c:/myprograms/clojure"))) ["build.xml" "changes.txt" "clj.ico" "clojure.jar" "epl-v10.html" "fractal.clj" "Mandelbrot.class"

somehow (quote foo) came back from the REPL

2009-02-02 Thread Terrence Brannon
I was fooling around in the REPL and from the looks of the transcript, I typed the very same thing, yet in one case the REPL returned (quote foo) and in the other case it returned foo. Transcript follows: user=> \newline \newline user=> \c \c user=> nil nil user=> false false user=> :foo :foo us

Re: need some help getting jacob com library to work

2009-02-02 Thread David Nolen
You need to add it to -cp argument when starting up the REPL, not your environment CLASSPATH. On Mon, Feb 2, 2009 at 9:05 PM, greg wrote: > > I have recently enjoyed exploring clojure. > > I can use java... > C:\myprograms\clojure>java -cp clojure.jar clojure.lang.Repl > Clojure > user=> (into [

Re: somehow (quote foo) came back from the REPL

2009-02-02 Thread Dan Larkin
On Feb 2, 2009, at 8:32 PM, Terrence Brannon wrote: > > I was fooling around in the REPL and from the looks of the transcript, > I typed the very same thing, yet in one case the REPL returned (quote > foo) and in the other case it returned foo. > > Transcript follows: > > user=> \newline > \newl

Re: Possible to create a much larger "world" than ants.clj?

2009-02-02 Thread Jason Wolfe
Are you launching Java with any flags? I think by default the heap limit is quite small (128 MB?) I use "java -server -Xmx1g ..." as my default for 1 gig of ram; you should be able to take it from there (-server makes long-running processes go faster, and perhaps more memory-efficient (?)). As

Re: Memory Consumption of Large Sequences

2009-02-02 Thread Luc Prefontaine
Paul sorry for the mistake, these emails are a pain to follow sometimes, Keith, It's up to you if you prefer to slice the Clojure features one by one down the bone marrow, as for myself I used a different approach to ramp up with Clojure ASAP The need to get down to implementation details came a

Re: Memory Consumption of Large Sequences

2009-02-02 Thread Mark H.
On Feb 2, 5:32 pm, Keith Bennett wrote: > I am just now learning Clojure, and for me, understanding what's going > on underneath the surface helps me understand how to use the language > properly.  As I said previously, the amount of memory consumed by a > list will very rarely be an issue.  Howe

Re: Memory Consumption of Large Sequences

2009-02-02 Thread Mark H.
On Feb 2, 5:32 pm, Keith Bennett wrote: > I have a lot of work to do to learn how to think in functional > programming.  These kinds of discussions are very helpful. A picky point -- lazy sequences aren't really a functional programming thing (although restricting side effects makes it easier to

Re: Questions about a Clojure Datalog

2009-02-02 Thread Jeffrey Straszheim
Datalog is a cool problem. I've started writing some code. The rule-unification part of the algorithm is trivial -- its not even proper unification at all. The hard part seems to be optimising the query strategy to avoid materialising too much. The advantage is you can support rules that would

Re: somehow (quote foo) came back from the REPL

2009-02-02 Thread Michael Wood
On Tue, Feb 3, 2009 at 5:07 AM, Dan Larkin wrote: > > > On Feb 2, 2009, at 8:32 PM, Terrence Brannon wrote: > >> >> I was fooling around in the REPL and from the looks of the transcript, >> I typed the very same thing, yet in one case the REPL returned (quote >> foo) and in the other case it retu