Is group-by lazy?

2010-05-25 Thread Michael Jaaka
Hi! I've noticed that there is group-by in clojure 1.2. However it uses reduce and conj. Doesn't it consume all sequence at once? Here I have lazy version I have written once: (defn group-by [input] (lazy-seq (when-let [s (seq input)] (let [k (ffirst s

Re: matchure becoming clojure.contrib.match

2010-05-25 Thread B Smith-Mannschott
On Mon, May 24, 2010 at 05:41, Drew Colthorp wrote: > A few weeks ago I announced a pattern matching library called > matchure. I'm excited to say it's being merged into clojure.contrib as > clojure.contrib.match. I'd like some feedback on ideas for some > backward-incompatible changes I'm plannin

Re: do clojure and la(tex) have something in common ?

2010-05-25 Thread Tim Daly
ka wrote: Tim, I don't know much about either lisp or latex :). But it looks like a really neat idea at a first thought to me. Have two remarks- 1. From the developer's pov - I'm not sure how the developer, who is accustomed to looking at just code + some comments, will manage working with t

Re: do clojure and la(tex) have something in common ?

2010-05-25 Thread faenvie
hello mike, hello tim thank you for this detailed insights into your experience and knowledge. lately i had to implement a generator for a big catalog of products and i used docbook for it, but that was not a satisfying experience at all. docbook locks you into its predefined document-structures

Re: do clojure and la(tex) have something in common ?

2010-05-25 Thread Dave Pawson
Another view. On 25 May 2010 07:25, ka wrote: > Tim, > > I don't know much about either lisp or latex :).  But it looks like a > really neat idea at a first thought to me.  Have two remarks- > 1. From the developer's pov - I'm not sure how the developer, who is > accustomed to looking at just cod

Clojure Eclipse Getting Started Question

2010-05-25 Thread Shikhar
Hi, I've just installed the Counterclockwise plugin and written a hello world program in a file named "hello.clj" --- (ns hello) (defn "a method" method [args] (println "Hello" args)) -

PDF generation with Clojure?

2010-05-25 Thread Jim Tittsler
Is there a library for generating PDF pages/reports with Clojure? (Or a Java library that interoperates more naturally than others?) -- 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 th

Re: Is group-by lazy?

2010-05-25 Thread Craig Andera
> I've noticed that there is group-by in clojure 1.2. However it uses > reduce and conj. > Doesn't it consume all sequence at once? Yes. But then, it would have to: - clojure.contrib.seq/group-by ([f coll]) Returns a sorted map of the elements of coll keyed by the result

Announcing Clojure/core

2010-05-25 Thread Rich Hickey
I'm happy to announce Clojure/core, a joint endeavor between myself and Relevance, Inc. Clojure/core is a specialized technical practice within Relevance, focused on Clojure. Featuring myself and Stuart Halloway as advisors, the team also includes Clojure experts such as David Liebke (Incanter), S

Re: PDF generation with Clojure?

2010-05-25 Thread Quzanti
I am not enough of a functional programming / Clojure expert to comment on which library would integrate best with Clojure. However I have always found iText to be badly designed (even though historically it has been the mindshare leader with most features) Also the licence on iText is GPL 3 with

Re: Announcing Clojure/core

2010-05-25 Thread Craig Andera
> I'm happy to announce Clojure/core, a joint endeavor between myself > and Relevance, Inc. Congratulations to everyone involved! Very exciting! -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups

Re: do clojure and la(tex) have something in common ?

2010-05-25 Thread Dave Pawson
On 24 May 2010 19:50, faenvie wrote: > lately i had to implement a generator for a big catalog of > products and i used docbook for it, but that was not a > satisfying experience at all. docbook locks you into > its predefined document-structures and is difficult to > customize - i really hate th

Re: Clojure Eclipse Getting Started Question

2010-05-25 Thread patrik karlin
(defn "a method" method [args] (println "Hello" args)) ok so im gonna gess that you should putt the docstring after the name (defn method "a method" [args] (println "hello" args)) 2010/5/24 Shikhar > Hi, > I've just installed the Counterclockwise plugin and written a hello > world program

Re: Clojure Eclipse Getting Started Question

2010-05-25 Thread Base
Hi Shikhar - I strongly recommend checking out the labrepl example created by stu halloway. It is a great starting point for eclipse/counterclockwise and helped me quite a bit as a framework for starting new projects. http://github.com/relevance/labrepl cheers. On May 24, 10:08 am, Shikhar wr

Re: Announcing Clojure/core

2010-05-25 Thread Base
woo hoo! Look forward to it. On May 25, 7:48 am, Craig Andera wrote: > > I'm happy to announce Clojure/core, a joint endeavor between myself > > and Relevance, Inc. > > Congratulations to everyone involved! Very exciting! > > -- > You received this message because you are subscribed to the Googl

Re: Is group-by lazy?

2010-05-25 Thread Michael Jaaka
Thanks you! Just noticed that after publishing that post. The clojure 1.2 group-by doesn't require sequence to be ordered by a grouping key. My func. is easy to modify to accept grouping selector and mapping function for grouped sequence. Thanks again. On 25 Maj, 14:23, Craig Andera wrote: > >

Why is MVCC history managed manually?

2010-05-25 Thread Peter
Hi Rich, Still can't reply on that thread, but I was able to start this one. "MVCC history in Clojure's STM is dynamic, created by need. There is no read tracking, and more important for this case, no transaction tracking." What's the issue with keeping a singly linked list of transa

Re: PDF generation with Clojure?

2010-05-25 Thread Base
There are several libraries that I have heard of. Here is a list of several. http://java-source.net/open-source/pdf-libraries I have only tried out iText and FOP with mixed results. On May 24, 5:22 pm, Jim Tittsler wrote: > Is there a library for generating PDF pages/reports with Clojure?  (

Re: do clojure and la(tex) have something in common ?

2010-05-25 Thread Mike Meyer
On Mon, 24 May 2010 11:50:41 -0700 (PDT) faenvie wrote: > hello mike, > hello tim > > thank you for this detailed insights into your experience > and knowledge. > > lately i had to implement a generator for a big catalog of > products and i used docbook for it, but that was not a > satisfying e

Comparing Cycle

2010-05-25 Thread sailormoo...@gmail.com
Hi : (def a (cycle '(1 2 3 4))) and (= a (drop 4 a)) I suppose it would return true, but it cannot return. -- 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 membe

Re: Why is MVCC history managed manually?

2010-05-25 Thread Rich Hickey
On May 25, 9:38 am, Peter wrote: > Hi Rich, > > Still can't reply on that thread, but I was able to start this one. > >     "MVCC history in Clojure's STM is dynamic, created by need. There > is no >     read tracking, and more important for this case, no transaction >     tracking." > > What's

Re: Comparing Cycle

2010-05-25 Thread Wilson MacGyver
since cycle is an infinite sequence, it will keep running forever. On Tue, May 25, 2010 at 11:05 AM, sailormoo...@gmail.com wrote: > Hi : > > (def a (cycle '(1 2 3 4))) > > and > > (= a (drop 4 a)) > > I suppose it would return true, but it cannot return. > > -- > You received this message becaus

Re: Announcing Clojure/core

2010-05-25 Thread Michael Gardner
On May 25, 2010, at 7:30 AM, Rich Hickey wrote: > Note: clojure.com will now resolve to the Clojure/core site. Come > check it out! Does this mean Clojure itself is to be directly associated with Relevance, Inc.? -- You received this message because you are subscribed to the Google Groups "Cloj

Re: Clojure on Android

2010-05-25 Thread Remco van 't Veer
On 2010/05/21 15:32, Remco van 't Veer wrote: > BTW the latest clojure may work on dalvik but probably won't due to > issue #199[1]. Checkout my clojure fork[2] for an ancient version of > clojure that does work on dalvik. I just confirmed the current master branch does run on dalvikvm. See my

Re: Announcing Clojure/core

2010-05-25 Thread Rich Hickey
On May 25, 11:18 am, Michael Gardner wrote: > On May 25, 2010, at 7:30 AM, Rich Hickey wrote: > > > Note: clojure.com will now resolve to the Clojure/core site. Come > > check it out! > > Does this mean Clojure itself is to be directly associated with Relevance, > Inc.? > Not at all. Clojure a

Re: do clojure and la(tex) have something in common ?

2010-05-25 Thread Dave Pawson
On 25 May 2010 15:04, Mike Meyer wrote: > On Mon, 24 May 2010 11:50:41 -0700 (PDT) > faenvie wrote: > A literate programming tool on the other hand only has to > deal with one type of document - literate programs. So while such a > tool might well be everything you're looking for, it might also

Re: Why is MVCC history managed manually?

2010-05-25 Thread Peter
Hi Rich, If you set up your object dependencies correctly then the objects you want will stay in memory. Your history list would be a list of WeakReference so it could be GC'd. This is nothing about read tracking, more about setting the correct object dependencies so that the GC doesn't remove ob

Re: Should repeatedly defining the same protocol in a file work?

2010-05-25 Thread Aaron Cohen
This seems to have been fixed in master at some point. -- 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 with your first po

Anyone experienced in using clojure as a "database"

2010-05-25 Thread Fabio Kaminski
Folks, i would like advice, cause since im starting something that will be eventually big data intensive, from scratch and i really like the options already built in in clojure like STM, parallelizing data and concurrency logic implemented on it i think its wonderfully tuned to use as database...

Re: Anyone experienced in using clojure as a "database"

2010-05-25 Thread Sean Devlin
You might want to look at FleetDB http://fleetdb.org/ http://github.com/mmcgrana/fleetdb On May 25, 2:08 pm, Fabio Kaminski wrote: > Folks, > > i would like advice, > cause since im starting something that will be eventually big data > intensive, from scratch > and i really like the options alre

Re: matchure becoming clojure.contrib.match

2010-05-25 Thread Jason Smith
I agree with Meikel on this one. Java isn't the best language, but they figured out how to package code in a way that makes it easy to reuse - the JAR. Maven may not be the easiest thing in the world to work with, but they got dependency management right. clojure-contrib should probably be broke

Re: Clojure Eclipse Getting Started Question

2010-05-25 Thread Shikhar Mishra
Yes, I realized it immediately after send this post. :) Even with the correction I could not get (method "world") to work in eclipse console REPL. I'm going to follow the http://github.com/relevance/labrepl link suggested by another responder. Thanks. On Tue, May 25, 2010 at 7:59 AM, patrik karl

Re: Clojure Eclipse Getting Started Question

2010-05-25 Thread Matthias von Rohr
set the cursor somewhere in your (defn...) expression then press Ctrl + Alt + x (evaluate in REPL). After that you method call should work. Matt On May 24, 5:08 pm, Shikhar wrote: > Hi, >  I've just installed the Counterclockwise plugin and written a hello > world program in a file named "hello.

Re: Clojure Eclipse Getting Started Question

2010-05-25 Thread Laurent PETIT
Hi Shikhar, Please also note that by hitting F1 (windows) , Help (Mac) or Ctrl+F1 (Linux/GTK), while in the editor, you go to the help page from within eclipse. Regards, -- Laurent 2010/5/25 Matthias von Rohr > set the cursor somewhere in your (defn...) expression then press Ctrl > + Alt + x

Help needed - Weird behavior

2010-05-25 Thread Sean Devlin
I'm experimenting w/ protocols * proxy (I have an Abstract Base Class I need). So far everything is awesome, then I get some first rate wierdness: http://gist.github.com/413571 Why does me unit-div fn work right, but my unit-mult fn totally go haywire? Confused. -- You received this message b

Todo item annotation in Clojure.

2010-05-25 Thread Thomas
I've made a small library for annotating Clojure programs with todo statements during development. The library is inspired by the //TODO: functionality in Eclipse and the fixme package in LaTeX. To use the lib, simply use (or require) clj-todo, and use the todo macro around your existing code. (t

Re: Help needed - Weird behavior

2010-05-25 Thread Hugo Duncan
On Tue, 25 May 2010 15:33:20 -0400, Sean Devlin wrote: I'm experimenting w/ protocols * proxy (I have an Abstract Base Class I need). So far everything is awesome, then I get some first rate wierdness: http://gist.github.com/413571 Why does me unit-div fn work right, but my unit-mult fn to

Re: Help needed - Weird behavior

2010-05-25 Thread Sean Devlin
Ah, yeah, you're right. Thanks! On May 25, 3:57 pm, "Hugo Duncan" wrote: > On Tue, 25 May 2010 15:33:20 -0400, Sean Devlin   > wrote: > > > I'm experimenting w/ protocols * proxy (I have an Abstract Base Class > > I need).  So far everything is awesome, then I get some first rate > > wierdness:

Re: Announcing Clojure/core

2010-05-25 Thread DiG
Congratulation! This is an especially great news for full time clojure programmers. It gives me an additional biz points when selling clojure to customers. On May 25, 8:30 am, Rich Hickey wrote: > I'm happy to announce Clojure/core, a joint endeavor between myself > and Relevance, Inc.  Clojure/c

Possible namespace bug

2010-05-25 Thread Brent Millare
May have found a bug, here is how to duplicate it. Hopefully someone can confirm this. Here is expected behavior when run in the repl: Clojure 1.2.0-master-SNAPSHOT user=> (ns foo) nil foo=> (defmacro f [] `(eval `(def ~'~'x 'foo))) #'foo/f foo=> (ns bar) nil bar=> (defn b [] (foo/f)) #'bar/b ba

Re: Anyone experienced in using clojure as a "database"

2010-05-25 Thread Savanni D'Gerinel
On 05/25/2010 01:36 PM, Sean Devlin wrote: > You might want to look at FleetDB > > http://fleetdb.org/ > http://github.com/mmcgrana/fleetdb I have not found the system to be incredibly well documented, but I have discovered that if you want to embed fleetdb in your app, you will need (use 'fleet

A simple csv parsing library

2010-05-25 Thread Jonas Enlund
Hi there I built a simple csv parsing library[1] last weekend which I want to show you guys. It follows the RFC 4180[2] pretty closely but it allows for any character as separator and quote mark. It would be great if someone would take time and read the code. I would like to know: a) Can performa

Re: Possible namespace bug

2010-05-25 Thread Meikel Brandmeyer
Hi, On May 26, 12:17 am, Brent Millare wrote: > ^^ That should read #'bar/x instead of #'user/x No. foo/f expands into a macro calling eval on a def. This eval is put into a function bar/b. When you call the function the namespace "in charge" is user. So everything is correct. Usual disclaimer

Re: Possible namespace bug

2010-05-25 Thread Brent Millare
Hi Meikel, Well if #'user/x is the correct behavior, then the repl behavior needs to be fixed. Either one may be "correct" but that does not explain the discrepancy. Also I agree that eval should be avoided, but I found an extreme case where it was necessary (due to the desired side effect of star

Re: Possible namespace bug

2010-05-25 Thread Brent Millare
Ah wait, I may have read that wrong. So what I understand is because I am calling it from the the -e, it is ran in the user ns. Ok that makes sense. On May 26, 2:28 am, Brent Millare wrote: > Hi Meikel, > > Well if #'user/x is the correct behavior, then the repl behavior needs > to be fixed. Eith

Re: Possible namespace bug

2010-05-25 Thread Meikel Brandmeyer
Hi, On May 26, 8:35 am, Brent Millare wrote: > Ah wait, I may have read that wrong. So what I understand is because I > am calling it from the the -e, it is ran in the user ns. Ok that makes > sense. Exactly! And in the Repl you are still in the bar namespace. Doing a (in-ns 'user) and then cal