Shootout fannkuch

2010-09-03 Thread Miki
Hello, I've tried writing a a solution to shootout fannkuch (http:// shootout.alioth.debian.org/u32/performance.php?test=fannkuchredux), however I seem to have a bug in the checksum. Is it just the order of permutations or am I missing something? Code at

Re: Thinking in Clojure

2010-09-03 Thread Sean Corfield
On Thu, Sep 2, 2010 at 6:29 PM, HB hubaghd...@gmail.com wrote: Usually we create some domain entities, map them with Hibernate/ iBatis. I don't know how a Clojure application would be build without objects. I wonder if watching this talk by Rich Hickey will help?

Why so?

2010-09-03 Thread vishy
It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures. -- Alan Perlis Why so? How is it advantageous? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Does 'require' with the :reload option have a tendency to build up memory?

2010-09-03 Thread Rayne
Indeed, that I did. I ran it through jvisualvm and it's definitely growing objects. It's odd though, because I don't see any reason why any of the namespaces I'm reloading would do that. It's not any one namespace, but all of them together. That's why I was thinking that it may have possibly been

deftype makes no extender?

2010-09-03 Thread alux
Hello, shouldnt the type x be listed a extender of xx here? Or why not? Thanks, alux (defprotocol xx example (xxx [x] some x'es)) (deftype x [] xx (xxx [x] :xxx)) (extenders xx) = nil -- You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: deftype makes no extender?

2010-09-03 Thread Meikel Brandmeyer
Hi, On 3 Sep., 12:49, alux alu...@googlemail.com wrote: shouldnt the type x be listed a extender of xx here? Or why not? No. It shows up if you actually use extend to the extend the protocol to the type. Sincerely Meikel -- You received this message because you are subscribed to the Google

Re: deftype makes no extender?

2010-09-03 Thread alux
Yes, thats what I see. I just dont think this is very sensible. Thank you Meikel! Greetings, alux On 3 Sep., 13:10, Meikel Brandmeyer m...@kotka.de wrote: Hi, On 3 Sep., 12:49, alux alu...@googlemail.com wrote: shouldnt the type x be listed a extender of xx here? Or why not? No. It

Re: Thinking in Clojure

2010-09-03 Thread Bob Hutchison
On 2010-09-02, at 10:02 PM, HB wrote: So in idiomatic Clojure applications, maps are considered like objects? And to operate on them we pass them to functions? I think that considering maps as a state representation is reasonable. There are alternatives, but that's fine-tuning I think.

Re: Why so?

2010-09-03 Thread Mark Hamstra
The context of the comment is functional programming vs. OO programming. Pure functions compose better than do state-containing objects, and 100! is much larger than 10!, so you have many more options for composition/reuse with 100 functions that operate on a single data abstraction. On Sep 3,

Re: Clojure 1.2 and the Computer Language Benchmarks Game

2010-09-03 Thread John Fingerhut
I've got about 5 to 10 Clojure programs I've written for each of the 5 benchmark programs (many of which are only minor variations of each other, looking for ways to make it faster). If you care to see any of the others, they are on github here: http://github.com/jafingerhut/clojure-benchmarks

Re: picking out a tag from a nested struct-map and xml-seq

2010-09-03 Thread Peter Buckley
Thanks Abishek, this did help! It pretty much worked as-is for me, I only needed one small change. It was that the get-mods-for-iva function below returns a seq whose first element is the matches and next element(s) were my entire xml content - easily rectified with (first (xz/xml1- x-zip... On

Re: Thinking in Clojure

2010-09-03 Thread Sean Allen
On Thu, Sep 2, 2010 at 9:29 PM, HB hubaghd...@gmail.com wrote: Hey, I finished reading Programming Clojure and Practical Clojure and I'm hooked :) Please count me in the Clojure club. But I failed how to think in Clojure. My main career is around Java web applications (Hibernate, Spring,

Re: Thinking in Clojure

2010-09-03 Thread Peter Buckley
I'm only a little ways through Joy of Clojure (my first Clojure book) but bear with me as I'm thinking aloud on what it means for me to think in Clojure. I hope list members will forgive me if I get things wrong - and please correct my working concept(s) as well. One of the things that stuck out

Re: Shootout fannkuch

2010-09-03 Thread John Fingerhut
Most likely. That one I found somewhat annoying in that the checksum computation does depend upon the permutations being generated in a particular order. It also seems to depend upon the sign flipping being done for every permutation, even those beginning with a '1', for which the pfannkuch

sequence rest and next

2010-09-03 Thread Abraham Varghese
I cannot understand between ( next aseq) and ( rest aseq) ... Thanks AV -- 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 - please be patient

Re: date serialization in clojure-contrib json

2010-09-03 Thread Stuart Sierra
Sorry, I can't accept any patch that modifies behavior globally. What happens when two different libraries try to parse JSON with different deserializers? The only thing I would consider is a function that is passed into read- json and invoked in read-json-object. But even that seems like adding

Re: date serialization in clojure-contrib json

2010-09-03 Thread Baishampayan Ghose
Sorry, I can't accept any patch that modifies behavior globally. What happens when two different libraries try to parse JSON with different deserializers? The only thing I would consider is a function that is passed into read- json and invoked in read-json-object. But even that seems like

Re: sequence rest and next

2010-09-03 Thread Meikel Brandmeyer
Hi, On 3 Sep., 11:16, Abraham Varghese abev...@gmail.com wrote: I cannot understand between  ( next aseq)   and ( rest aseq) ... next will realise the first item of the rest of aseq, while rest will not. You can always express next in terms of rest: (defn next [s] (seq (rest s)))

Re: building new contrib against a specific clojure jar

2010-09-03 Thread Stuart Sierra
On Sep 2, 5:35 pm, braver delivera...@gmail.com wrote: Can it be done on the command line, with -Dclojure.version=... ? Yes! And a correction: Clojure snapshots are labeled 1.3.0-master-SNAPSHOT -S -- You received this message because you are subscribed to the Google Groups Clojure group. To

Re: deftype makes no extender?

2010-09-03 Thread Stuart Halloway
Let's back up: what are you trying to do with 'extenders'? Stu Yes, thats what I see. I just dont think this is very sensible. Thank you Meikel! Greetings, alux On 3 Sep., 13:10, Meikel Brandmeyer m...@kotka.de wrote: Hi, On 3 Sep., 12:49, alux alu...@googlemail.com wrote:

¿Clojure en España? - Clojure in Spain?

2010-09-03 Thread soyrochus
¿Hay alguien que están utilizando Clojure, profesionalmente o de otro tipo, en España? Si es así, tal vez podríamos poner algo en marcha, como un encuentro o el comienzo de un grupo de usuarios de Clojure . Estilo Español... -- Anyone around who uses Clojure in Spain? Professionally, for study

Re: ¿Clojure en España? - Clojure in Spain?

2010-09-03 Thread Angel Java Lopez
There is a list http://groups.google.com/group/clojure-hispano low traffic, but I hope more Spanish developers will participate in discussions. I guess @hhariri is research about Clojure in Spain. Angel Java Lopez http://www.ajlopez.com http://twitter.com/ajlopez On Fri, Sep 3, 2010 at 11:34

Re: Shootout fannkuch

2010-09-03 Thread Isaac Gouy
On Sep 2, 11:45 pm, John Fingerhut andy.finger...@gmail.com wrote: Most likely.  That one I found somewhat annoying in that the checksum computation does depend upon the permutations being generated in a particular order. Fannkuch has required the permutations to be generated in a particular

Re: Thinking in Clojure

2010-09-03 Thread MarkH
Sean and Peter made comments that ring very true for me. I've always had a problem with Java/Smalltalk/C# type OO. I also thought the Common Lisp/Dylan way of generic functions and data structures made more sense. Like Peter mentioned, I tend to think in terms of verbs and transformations of

Re: Thinking in Clojure

2010-09-03 Thread Chouser
On Thu, Sep 2, 2010 at 11:36 PM, Peter Buckley buckmeist...@gmail.com wrote: One of the things that stuck out for me that I heard somewhere (can't remember exactly) was that OOP is about framing questions in terms of nouns and FP is about framing questions in terms of verbs. Perhaps you heard

Re: Why so?

2010-09-03 Thread fin
It is better to have 100 functions in one category than 10 functions in 10 categories? I don't think so. See: http://clojure.github.com/clojure/clojure.core-api.html -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Thinking in Clojure

2010-09-03 Thread Michael Ossareh
On Thu, Sep 2, 2010 at 21:05, Miki miki.teb...@gmail.com wrote: I'd go over SICP, though it not in Clojure but in Scheme - it will show you how to think functional. +1 on this. http://mitpress.mit.edu/sicp/ -- !new number! 415-400-6772 -- You received this message because you are

Re: ¿Clojure en España? - Clojure in Spain ?

2010-09-03 Thread Alvaro Videla
I'm not in Spain but I certainly speak Español Saludos, Alvaro On Sep 3, 2010, at 10:34 PM, soyrochus wrote: ¿Hay alguien que están utilizando Clojure, profesionalmente o de otro tipo, en España? Si es así, tal vez podríamos poner algo en marcha, como un encuentro o el comienzo de un

Additional copy methods for URLs in clojure.java.io

2010-09-03 Thread mrBliss
Hi, I was wondering why there aren't versions of the copy method in clojure.java.io that handle URLs as input. I have needed, written and reused them several times now. So I thought it would be a good idea to include them in clojure.java.io. Adding the following methods and updating the

Re: Why so?

2010-09-03 Thread David Nolen
On Fri, Sep 3, 2010 at 11:50 AM, fin gpl...@gmail.com wrote: It is better to have 100 functions in one category than 10 functions in 10 categories? I don't think so. See: http://clojure.github.com/clojure/clojure.core-api.html Clojure functions categorized:

Re: date serialization in clojure-contrib json

2010-09-03 Thread Stuart Sierra
You can already extend the Write-JSON protocol to any type. But it doesn't work in reverse. JSON has no standardized way to express types beyond Object/Array/String/Number, so any deserialization will always be application-specific. -S On Sep 3, 8:58 am, Baishampayan Ghose b.gh...@gmail.com

Re: Why so?

2010-09-03 Thread Alan
A very handy web page to have around; thanks for mentioning it. It looks nice too, but the accessibility is a bit poor - when I look at it with an increased text size, the CSS quickly falls apart and renders it confusing and/or unreadable. So if the maintainer for that site is on this newsgroup

Re: Thinking in Clojure

2010-09-03 Thread HB
Really nice example Peter, Thanks, I appreciate it. On Sep 3, 6:36 am, Peter Buckley buckmeist...@gmail.com wrote: I'm only a little ways through Joy of Clojure (my first Clojure book) but bear with me as I'm thinking aloud on what it means for me to think in Clojure. I hope list members will

Re: Thinking in Clojure

2010-09-03 Thread CuppoJava
I had the exact same problem transitioning from OOP to Lisp, and I can only offer my own experiences. I finally understood lisp, by programming a new pet project FROM SCRATCH, in the most STRAIGHTFORWARD way possible. I originally started by porting over a program I had written in Java, and found

Re: date serialization in clojure-contrib json

2010-09-03 Thread Dmitri
The problem I was trying to avoid is having to do a second pass over the data after it comes out of the parser, it's more expensive and it's also ugly for nested data structures. Would using defonce- and defmacro- from clojure-contrib address the problem with namespace collisions? On Sep 3, 12:01 

Re: Thinking in Clojure

2010-09-03 Thread Raoul Duke
On Fri, Sep 3, 2010 at 8:23 AM, Michael Ossareh ossa...@gmail.com wrote: I'd go over SICP, though it not in Clojure but in Scheme - it will show you how to think functional. +1 on this. http://mitpress.mit.edu/sicp/ i think some folks argue that http://www.htdp.org/ is even better :-) or at

Re: Shootout fannkuch

2010-09-03 Thread Isaac Gouy
On Sep 2, 11:01 pm, Miki miki.teb...@gmail.com wrote: Hello, I've tried writing a a solution to shootout fannkuch (http:// shootout.alioth.debian.org/u32/performance.php?test=fannkuchredux), however I seem to have a bug in the checksum. Is it just the order of permutations or am I missing

Re: Does 'require' with the :reload option have a tendency to build up memory?

2010-09-03 Thread Chouser
On Fri, Sep 3, 2010 at 6:05 AM, Rayne disciplera...@gmail.com wrote: Indeed, that I did. I ran it through jvisualvm and it's definitely growing objects. It's odd though, because I don't see any reason why any of the namespaces I'm reloading would do that. It's not any one namespace, but all of

clojure-conj registration is now open!

2010-09-03 Thread Stuart Halloway
We're happy to announce that the official (first clojure-conj) conference site is now live at http://clojure-conj.org, and that registration is open. To register, visit http://clojure-conj.org and click Register. The conj begins Friday, October 22 and completes the next day, Saturday, October

Re: date serialization in clojure-contrib json

2010-09-03 Thread Stuart Sierra
No. I'm talking about collisions when multiple deserialization functions are added from different sources. It cannot be a global setting. -S On Sep 3, 1:28 pm, Dmitri dmitri.sotni...@gmail.com wrote: The problem I was trying to avoid is having to do a second pass over the data after it comes

Re: Minor macroexpand issue

2010-09-03 Thread Konrad Hinsen
On 1 Sep 2010, at 08:25, Konrad Hinsen wrote: Right, but then this should be blamed on macroexpand-all, which implements a crude approximation to how macroexpansion is done by the compiler. There's also clojure.contrib.macro-utils/mexpand-all, which does a much better job, but still

Re: clojure-conj registration is now open!

2010-09-03 Thread Justin Kramer
Thanks and congratulations to the Clojure/core team for making this happen. Can't wait! Justin On Sep 3, 3:15 pm, Stuart Halloway stuart.hallo...@gmail.com wrote: We're happy to announce that the official (first clojure-conj) conference site is now live athttp://clojure-conj.org, and that

Re: clojure-conj registration is now open!

2010-09-03 Thread Sean Corfield
Dang! Wish I could be there but it clashes with a previous commitment in Albuquerque (a cat show - seriously!). Do you have a sense of what level the talks are going to be at? Would a Clojure n00b get a lot of value out of it or are most of the talks going to be advanced? (I'd expect the latter

Re: date serialization in clojure-contrib json

2010-09-03 Thread Dmitri
That's a very good point, I can't think of a good way to address that off top of my head, I agree that passing in a function isn't really great either. On Sep 3, 3:17 pm, Stuart Sierra the.stuart.sie...@gmail.com wrote: No. I'm talking about collisions when multiple deserialization functions

Re: Blogs/Twitter accounts about Clojure

2010-09-03 Thread Christian Guimarães
Everybody here has a common interest. Clojure. And I think that all people here can contribute with relevant informations. So, why not follow the guys from this list. Interested? Add your twitter account bellow. Cheers. @csgui (Christian Guimaraes) On 2010/09/03, at 02:18, HB wrote: This

Re: Why so?

2010-09-03 Thread Steven E. Harris
David Nolen dnolen.li...@gmail.com writes: Clojure functions categorized: http://clojuredocs.org/quickref/Clojure%20Core Wow, that is very nice -- especially the expandable view of the implementation source. -- Steven E. Harris -- You received this message because you are subscribed to the

Re: Blogs/Twitter accounts about Clojure

2010-09-03 Thread Sean Allen
2010/9/3 Christian Guimarães cguimaraes...@gmail.com: Everybody here has a common interest. Clojure. And I think that all people here can contribute with relevant informations. So, why not follow the guys from this list. Interested? Add your twitter account bellow. Cheers. @csgui

Re: Extending Clojure's STM with external transactions

2010-09-03 Thread Alyssa Kwan
Revision number is a great idea! I don't think I want to do copy-on-write within Clojure because it would require a separate thread for cleanup. The underlying database should take care of it anyways. Thanks! Alyssa On Sep 2, 8:47 am, Timothy Baldridge tbaldri...@gmail.com wrote: It checks the

Re: Extending Clojure's STM with external transactions

2010-09-03 Thread Alyssa Kwan
ITA. I was planning on doing what clojure.contrib.sql does with a global var and with-connection block for dynamic binding. Unless people don't like that approach... On Sep 2, 12:56 pm, Mike Meyer mwm-keyword-googlegroups. 620...@mired.org wrote: On Wed, 1 Sep 2010 15:14:45 -0700 (PDT)

Re: Why so?

2010-09-03 Thread Paul deGrandis
Thanks for sharing this link David. Love it. On Sep 3, 8:54 am, David Nolen dnolen.li...@gmail.com wrote: On Fri, Sep 3, 2010 at 11:50 AM, fin gpl...@gmail.com wrote: It is better to have 100 functions in one category than 10 functions in 10 categories? I don't think so. See:

Re: Thinking in Clojure

2010-09-03 Thread jt
This may help! http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/ These twenty video lectures by Hal Abelson and Gerald Jay Sussman are a complete presentation of the course, given in July 1986 for Hewlett- Packard employees, and professionally produced by Hewlett-Packard

Re: Thinking in Clojure

2010-09-03 Thread HB
I'm interested in Conjure webframework and I'm considering trying to read its source code and participate later. What do you think? Do you other projects in mind? This discussion is amazing guys :) On Sep 3, 8:25 pm, CuppoJava patrickli_2...@hotmail.com wrote: I had the exact same problem

Re: Shootout fannkuch

2010-09-03 Thread Miki
Fannkuch has required the permutations to be generated in a particular order for years because too many programmers contributed programs that did not generate some of the permutations or used faster algorithms to generate the permutations. I've read several implementation so far and I'm still

Re: Blogs/Twitter accounts about Clojure

2010-09-03 Thread Sean Corfield
2010/9/3 Christian Guimarães cguimaraes...@gmail.com: Interested? Add your twitter account bellow. Cheers. @csgui (Christian Guimaraes) @seancorfield (Sean Corfield - caveat: I do more CFML than anything else with some Scala) -- Sean A Corfield -- (904) 302-SEAN Railo Technologies, Inc. --

Re: Blogs/Twitter accounts about Clojure

2010-09-03 Thread Sean Corfield
On Thu, Sep 2, 2010 at 9:33 AM, Sean Allen s...@monkeysnatchbanana.com wrote: @stuartholloway @stuarthalloway Note the 'a'. With an 'o' it's a British soccer coach :) -- Sean A Corfield -- (904) 302-SEAN Railo Technologies, Inc. -- http://getrailo.com/ An Architect's View --

Re: clojure-conj registration is now open!

2010-09-03 Thread Nick Brown
Yeah, I'm in the same boat. A conference I want to attend right in my backyard and its the same weekend as my high school class reunion... On Sep 3, 4:27 pm, Sean Corfield seancorfi...@gmail.com wrote: Dang! Wish I could be there but it clashes with a previous commitment in Albuquerque (a cat

Re: clojure-conj registration is now open!

2010-09-03 Thread Chas Emerick
On Sep 3, 8:06 pm, Nick Brown nwbr...@gmail.com wrote: Yeah, I'm in the same boat.  A conference I want to attend right in my backyard and its the same weekend as my high school class reunion... Everyone's different, but if I were you, I'd opt for just about any conference compared to going to

Re: clojure-conj registration is now open!

2010-09-03 Thread Wilson MacGyver
I too was very excited till I found out the date. I'm giving a talk on riak in Detroit on that Saturday. Maybe next year. -- 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: Shootout fannkuch

2010-09-03 Thread Isaac Gouy
On Sep 3, 4:24 pm, Miki miki.teb...@gmail.com wrote: Fannkuch has required the permutations to be generated in a particular order for years because too many programmers contributed programs that did not generate some of the permutations or used faster algorithms to generate the

[Weekend Chat] A secretly Clojure web framework?

2010-09-03 Thread HB
Hey, Since Relevance is heavily investing in Clojure, do you think they are working on a Clojure web framework? Personally, I wish. -- 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

Re: Extending Clojure's STM with external transactions

2010-09-03 Thread nchubrich
How about introducing a second part to the api? (store) creates a wrapper for the persistent address, and refp then takes one of those wrappers and the name? I like that. I would go one step further and say refp should have a default data store that is used unless you specify anything else