Re: A Clojure documentation browser

2009-02-16 Thread rzeze...@gmail.com
On Feb 12, 3:31 pm, Craig Andera craig.and...@gmail.com wrote: Nice work! Thanks. Two things related to 'strcat'. 1) This is already implemented as clojure.core/str (and is more efficient than concat'ing) 2) This function is never called :) Yeah, that code was cut and pasted from

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread Konrad Hinsen
On Feb 16, 2009, at 3:44, Rich Hickey wrote: There will need to be good descriptions of these, but the similarity is more in names than anything else - seqs are what they always were - cursors, and sequences are just collections. That distinction is quite clear, the problem is indeed just in

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread James Reeves
On Feb 15, 5:18 pm, Rich Hickey richhic...@gmail.com wrote: The second option is to choose the best possible names, and deal with some short term pain in porting and confusion. I think the best names are: ;item (first x) ;collection of remaining items, possibly empty (rest x) ;seq on

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread Christophe Grand
Hi, Rich Hickey a écrit : I am looking for feedback from people willing to read and understand the linked-to documentation and the fully lazy model, and especially from those trying the lazy branch code and porting some of your own. I just ported Enlive

Re: IntelliJ Plugin -- Wonderful News!

2009-02-16 Thread Johan Berntsson
I see that IntelliJ has a free edition called TeamCity. Will the clojure plugin work on that IDE too? On Feb 6, 7:33 am, Peter Wolf opus...@gmail.com wrote: Check out this email!  IntelliJ is going to get a *really* good plugin for Clojure :-D I have gladly turned control of the my plugin

Re: Example of use of Atom: Fibonacci generator

2009-02-16 Thread Timothy Pratley
Also consider (from http://en.wikibooks.org/wiki/Clojure_Programming/Examples): (defn fib-seq [] ((fn rfib [a b] (lazy-cons a (rfib b (+ a b 0 1)) user (take 20 (fib-seq)) (0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181) Regards, Tim.

Re: Concurrency and file writing

2009-02-16 Thread Jeff Rose
I think it depends on whether this is CPU or IO bound, where the files will be stored and how expensive it is to generate blocks, check for existence, copy etc. Over a distributed filesystem running across data-centers the decision will probably be different than on a multi-core cpu on a

Re: Example of use of Atom: Fibonacci generator

2009-02-16 Thread timc
Thanks for these interesting replies - I have some way to go in my understanding of the power of functional programming. I look forward to seeing Stuart's chapter 5! On Feb 16, 11:25 am, Timothy Pratley timothyprat...@gmail.com wrote: Also consider

Re: error-kit + test-is

2009-02-16 Thread Chouser
On Mon, Feb 16, 2009 at 1:50 AM, David Nolen dnolen.li...@gmail.com wrote: I don't quite understand why you got through all that work to get error-str -- isn't it just (str (qualify-sym error-type))? ...and since you then use it only as an arg to 'symbol' or 'str', you could just use the

Re: unintended consequences of printing

2009-02-16 Thread Chouser
On Mon, Feb 16, 2009 at 4:30 AM, bOR_ boris.sch...@gmail.com wrote: (remove-method print-method clojure.lang.IDeref) works like a charm, but (binding [*print-level* 1] @(world 1)) doesn't seem to have the desired effect. Not sure why not. Entering that at the REPL will change the

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread Mibu
I'm all for breaking bad habits and names and I love it that you give good design considerations precedence over heritage, but here I think using the first/rest/next combo is confusing, and will continue to be confusing in the long-term. rest is expected to be a sequence by Lispers, and next is

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread Jeffrey Straszheim
I'd vote for the breaking changes. We don't have so much code written that it cannot be fixed. However, this depends on the book in production. Having _Programming Clojure_ come out with incompatible code would be a big blow, I think. On Mon, Feb 16, 2009 at 9:22 AM, Mibu mibu.cloj...@gmail.com

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread jwhitlark
While I'm fairly new to clojure, and with apologies to Stewart Halloway for complicating his job on the book, (which is excellent so far, btw) I think it would be worth while to chose the optimum naming convention, if it can be done fast enough to update the book. Consider how long some warts had

Clojure's version display

2009-02-16 Thread Alin Popa
Hi, There is a way to display the current clojure's version ? Something like java -cp $CLOJURE_JAR:$CLOJURE_CONTRIB_JAR clojure.main -v Thanks. Alin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group.

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread Mark Volkmann
If we're going to be making name changes that break code anyway, I'll make another appeal to make the function naming convention more consistent. Most multi-word function names have a hyphen between the words, but the following do not. butlast, doall, dorun, doseq, dosync, dotimes, doto, fnseq,

compiling a GUI app and also: interference of Java's built-in architechture

2009-02-16 Thread rob levy
Hi, I know that all Java GUI libraries can be used within the REPL, but it is my understanding that in order to make it self-contained and executable (a jar or a class file), it is necessary to write some Java and call the Clojure code from the java applet or application. Is this true, or am I

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread Dan
On Mon, Feb 16, 2009 at 10:10 AM, Mark Volkmann r.mark.volkm...@gmail.comwrote: If we're going to be making name changes that break code anyway, I'll make another appeal to make the function naming convention more consistent. Most multi-word function names have a hyphen between the words,

Re: compiling a GUI app and also: interference of Java's built-in architechture

2009-02-16 Thread Dan
I know that all Java GUI libraries can be used within the REPL, but it is my understanding that in order to make it self-contained and executable (a jar or a class file), it is necessary to write some Java and call the Clojure code from the java applet or application. Is this true, or am I

Re: Clojure's version display

2009-02-16 Thread Stephen C. Gilardi
On Feb 16, 2009, at 3:39 AM, Alin Popa wrote: Hi, There is a way to display the current clojure's version ? Something like java -cp $CLOJURE_JAR:$CLOJURE_CONTRIB_JAR clojure.main -v Thanks. Alin I think if a Clojure version identifier existed, that would be a good way to print it. I

Re: compiling a GUI app and also: interference of Java's built-in architechture

2009-02-16 Thread levand
I know that all Java GUI libraries can be used within the REPL, but it is my understanding that in order to make it self-contained and executable (a jar or a class file), it is necessary to write some Java and call the Clojure code from the java applet or application.  Is this true, or am I

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread David Nolen
butlast, doall, dorun, doseq, dosync, dotimes, doto, fnseq, gensym, macroexpand, macroexpand-1, mapcat, nthrest -1 Because they are similar to other Lisps I assume. The same reason for println vs print-line. Changing these are a bad idea in IMHO. Breaking the meaning of rest with Common

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread Rich Hickey
On Feb 16, 2009, at 11:25 AM, David Nolen wrote: butlast, doall, dorun, doseq, dosync, dotimes, doto, fnseq, gensym, macroexpand, macroexpand-1, mapcat, nthrest -1 Because they are similar to other Lisps I assume. The same reason for println vs print-line. Changing these are a bad

Re: compiling a GUI app and also: interference of Java's built-in architechture

2009-02-16 Thread levand
I agree, Jambi is a better all-round product... but why the Swing hate? It's fine for what it is. Most of it's drawbacks (horrible LF, poor performance) are things of the past, now. It would definitely be my framework of choice for a quick, one-off app or an applet. -Luke On Feb 16, 10:50 am,

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread wlr
Regarding Programming Clojure: I think that placing the burden of book vs actual incompatibility upon Rich is misplaced. If anything, pressure from the Clojure community should be placed on the Pragmatic Programmers to allow Stuart to do the right thing regarding when the book is released, viz.,

Re: compiling a GUI app and also: interference of Java's built-in architechture

2009-02-16 Thread David Nolen
On Mon, Feb 16, 2009 at 10:27 AM, rob levy r.p.l...@gmail.com wrote: So if I am right about these two facts, it seems like Clojure should include a native way of making applets/applications that both enables the truly functional style that Clojure is built on, and doesn't require writing Java

Re: compiling a GUI app and also: interference of Java's built-in architechture

2009-02-16 Thread Tom Ayerst
Also, don't forget that Jambi is a vanilla GPL 2.0, so make sure all your licenses are compatible and you don't mind publishing your source (personally I don't, but you should be aware). Tom 2009/2/16 levand luke.vanderh...@gmail.com I agree, Jambi is a better all-round product... but why

Re: IntelliJ Plugin -- Wonderful News!

2009-02-16 Thread Tom Ayerst
Team City is not an IDE, it is a continuous integration server. I think Jetbrains give it away to Intellij licensees. Tom 2009/2/16 Johan Berntsson johan.may...@gmail.com I see that IntelliJ has a free edition called TeamCity. Will the clojure plugin work on that IDE too? On Feb 6, 7:33

Re: compiling a GUI app and also: interference of Java's built-in architechture

2009-02-16 Thread Dan
On Mon, Feb 16, 2009 at 11:51 AM, Tom Ayerst tom.aye...@gmail.com wrote: Also, don't forget that Jambi is a vanilla GPL 2.0, so make sure all your licenses are compatible and you don't mind publishing your source (personally I don't, but you should be aware). Tom Only until Qt 4.5 which

Re: cljc?

2009-02-16 Thread Emeka
Meikel, Could explain your code such that somebody like me could understand it and even play with it? Regards, Emeka --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread Perry Trolard
I agree with the majority of posters that the breaking changes in the service of optimal names is the right way to go. I found the explanation recipe for porting at clojure.org/lazier clear easy to follow. I didn't do full ports of any projects, but I did some selective porting found it to be

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread Jeffrey Straszheim
You're right, of course, but in life compromises must happen. If Rich proceeds *with no regard* for Pragmatic's needs, they have a recourse which is simply no Clojure book. Or a Clojure book that has broken examples. On Mon, Feb 16, 2009 at 11:34 AM, wlr geeked...@gmail.com wrote: Regarding

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread Perry Trolard
cursor moving to the next item rather than the abstracted rest of the coll (where you think about a cursor). Correction: where you *don't* think about a cursor... Perry --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: compiling a GUI app and also: interference of Java's built-in architechture

2009-02-16 Thread Laurent PETIT
2009/2/16 Dan redalas...@gmail.com On Mon, Feb 16, 2009 at 11:33 AM, levand luke.vanderh...@gmail.comwrote: I agree, Jambi is a better all-round product... but why the Swing hate? It's fine for what it is. Most of it's drawbacks (horrible LF, poor performance) are things of the past, now.

Re: error-kit + test-is

2009-02-16 Thread David Nolen
(defmethod assert-expr 'raised? [msg [_ error-type body :as form]] (let [error-name (qualify-sym error-type)] `(with-handler (do ~...@body (report :fail ~msg '~form ~(str error-name not raised.))) (handle ~error-type {:as err#} (report :pass ~msg '~form

New lazy branch of clojure-contrib

2009-02-16 Thread Stuart Sierra
I created a lazy branch of clojure-contrib to track patches to contrib that are needed in the lazy branch of Clojure. For clojure-contrib hackers: svn checkout https://clojure-contrib.googlecode.com/svn/branches/lazy clojure-contrib-lazy --username your.google.account For everyone else: svn

Re: error-kit + test-is

2009-02-16 Thread Chouser
On Mon, Feb 16, 2009 at 12:13 PM, David Nolen dnolen.li...@gmail.com wrote: I believe handle does the isa? check on the error type, correct? Right. If so then this will allow inherited error types to pass the test. Sounds good! --Chouser

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread wlr
On Feb 16, 12:06 pm, Jeffrey Straszheim straszheimjeff...@gmail.com wrote: You're right, of course, but in life compromises must happen.  If Rich proceeds *with no regard* for Pragmatic's needs, they have a recourse which is simply no Clojure book.  Or a Clojure book that has broken examples.

Anonymous recursive functions

2009-02-16 Thread Konrad Hinsen
I just discovered a nice feature that I don't remember having seen discussed or documented before: there is a way to write recursive functions without having them associated to any var/symbol in any namespace. The optional name of a function can be used for a recursive call. Example:

Re: compiling a GUI app and also: interference of Java's built-in architechture

2009-02-16 Thread Dan
Hello, Do you know of a good pointer that goes beyond the don't use it argument, and really makes a thorough comparison of pros and cons of the 2 frameworks ? I'm not saying don't use Swing, I'm saying prefer Jambi. My memory of Swing is dated so I'd have trouble making a thorough

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread Stuart Halloway
Thanks Rich! :-) , 2009, at 11:25 AM, David Nolen wrote: butlast, doall, dorun, doseq, dosync, dotimes, doto, fnseq, gensym, macroexpand, macroexpand-1, mapcat, nthrest -1 Because they are similar to other Lisps I assume. The same reason for println vs print-line. Changing these are

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread Stuart Halloway
I agree with Walt, and there is no need to pressure the Prags, we are on it! :-) That said, it would be *very* helpful to me if we could get the lazyness thing settled this week... Stuart Regarding Programming Clojure: I think that placing the burden of book vs actual incompatibility

Re: Clojure's version display

2009-02-16 Thread Alin Popa
Got the idea. Thanks Steve. On Mon, Feb 16, 2009 at 5:58 PM, Stephen C. Gilardi squee...@mac.comwrote: On Feb 16, 2009, at 3:39 AM, Alin Popa wrote: Hi, There is a way to display the current clojure's version ? Something like java -cp $CLOJURE_JAR:$CLOJURE_CONTRIB_JAR clojure.main -v

Re: Anonymous recursive functions

2009-02-16 Thread Christian Vest Hansen
There's a couple of Fibonacci's on the wiki that uses this approach: http://en.wikibooks.org/wiki/Clojure_Programming/Examples#Lazy_Fibonacci On Mon, Feb 16, 2009 at 6:50 PM, Konrad Hinsen konrad.hin...@laposte.net wrote: I just discovered a nice feature that I don't remember having seen

Re: why fn key doesn't do what I want?

2009-02-16 Thread Emeka
Thanks, Meikel --~--~-~--~~~---~--~~ 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

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread Rich Hickey
On Feb 15, 12:18 pm, Rich Hickey richhic...@gmail.com wrote: I'm pretty much finished with the fully-lazy implementation and am happy so far with the results. I think this will be an important addition to Clojure and am planning to add it. Thanks all for the feedback! It seems the

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread James Reeves
On Feb 16, 2:22 pm, Mibu mibu.cloj...@gmail.com wrote: rest is expected to be a sequence by Lispers, and next is expected to be an item by Java-ers. I actually think next is pretty close to the next method on Java iterators. In java.util.Iterator, the next method evaluates the next item,

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread Luc Prefontaine
We are in production and we fully agree, this thing should be settled now. In fact if it's done within 10 days, that would fit our current plans. For reasons out of our control we have been postponing an update to prod., we still have a window to get this change out. It's feasible to do the code

Re: compiling a GUI app and also: interference of Java's built-in architechture

2009-02-16 Thread Laurent PETIT
Thanks, -- Laurent 2009/2/16 Dan redalas...@gmail.com Hello, Do you know of a good pointer that goes beyond the don't use it argument, and really makes a thorough comparison of pros and cons of the 2 frameworks ? I'm not saying don't use Swing, I'm saying prefer Jambi. My memory of

Re: A Clojure documentation browser

2009-02-16 Thread Craig Andera
I think a problem with the current layout is that once you jump to one of the library sections you have to manually scroll back up to the index. There are a few different ways this could be solved. a) You could just add a top link to each library section banner. b) Only show the currently

Re: compiling a GUI app and also: interference of Java's built-in architechture

2009-02-16 Thread chris
I would have to strongly disagree that QT is a good idea for clojure development. I have posted about this several times before but I find that QT isn't ready for heavy java dev just yet, at least on the mac. 1. QT jambi will not run on the mac unless you are using java 1.5. This is because QT

Re: New lazy branch of clojure-contrib

2009-02-16 Thread chris
It would be nice if patches were accompanied by failing (and after patching, fixed) tests so that we can get a higher level of formalism and confidence out of both clojure and clojure.contrib. These tests would also be good lessons for newer people about some of the gotchas with lazy eval.

terminology question re: binding

2009-02-16 Thread Stuart Halloway
David Sletten sent me this erratum: At the beginning of section 2.4 we have The symbol user/foo refers to a var which is bound to the value 10. Under the next subsection Bindings we have Vars are bound to names, but there are other kinds of bindings as well. The Common Lisp standard

Re: New lazy branch of clojure-contrib

2009-02-16 Thread Jeffrey Straszheim
Isn't that second url just the normal one for contrib trunk? On Mon, Feb 16, 2009 at 12:23 PM, Stuart Sierra the.stuart.sie...@gmail.com wrote: I created a lazy branch of clojure-contrib to track patches to contrib that are needed in the lazy branch of Clojure. For clojure-contrib hackers:

Re: New lazy branch of clojure-contrib

2009-02-16 Thread Stephen C. Gilardi
On Feb 16, 2009, at 3:52 PM, Jeffrey Straszheim wrote: Isn't that second url just the normal one for contrib trunk? Yes, you should replace trunk with branches/lazy there as well. --Steve smime.p7s Description: S/MIME cryptographic signature

Re: New lazy branch of clojure-contrib

2009-02-16 Thread Stuart Sierra
On Feb 16, 3:52 pm, Jeffrey Straszheim straszheimjeff...@gmail.com wrote: Isn't that second url just the normal one for contrib trunk? Oops, sorry. svn checkout http://clojure-contrib.googlecode.com/svn/branches/lazy/ clojure- contrib-lazy --~--~-~--~~~---~--~~

Re: New lazy branch of clojure-contrib

2009-02-16 Thread Jeffrey Straszheim
Good. I was worried I'd be forced over to the Lazy branch before I was ready. :) On Mon, Feb 16, 2009 at 4:05 PM, Stephen C. Gilardi squee...@mac.comwrote: On Feb 16, 2009, at 3:52 PM, Jeffrey Straszheim wrote: Isn't that second url just the normal one for contrib trunk? Yes, you should

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread Rich Hickey
On Feb 16, 2009, at 3:56 PM, Stephen C. Gilardi wrote: On Feb 16, 2009, at 2:23 PM, Rich Hickey wrote: New docs here: http://clojure.org/lazy In the html doc: rest... returns a possibly empty seq, never nil then later never returns nil - currently not

Re: terminology question re: binding

2009-02-16 Thread Chouser
On Mon, Feb 16, 2009 at 3:34 PM, Stuart Halloway stuart.hallo...@gmail.com wrote: David Sletten sent me this erratum: At the beginning of section 2.4 we have The symbol user/foo refers to a var which is bound to the value 10. Under the next subsection Bindings we have Vars are bound to

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread Aaron Scott
How about e-rest, for the empty set returning version? Perry Trolard wrote: If it's the case that rest will almost exclusively appear in the context of constructing lazy-seqs (lazy-seq (cons [something] (rest [something])) next will appear all over, it makes sense to me to

Re: terminology question re: binding

2009-02-16 Thread Chouser
On Mon, Feb 16, 2009 at 5:29 PM, Chouser chou...@gmail.com wrote: I don't know if it's more correct, but it might be less confusing to say The symbol user/foo is bound to a var which has a root value of 10. Eh, well, I'm not sure about that first part. I don't know if the symbol is bound to

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread Mark Engelberg
Browsing the source code for LazySeq, I noticed that isEmpty is implemented as follows: public boolean isEmpty() { return count() == 0; } Since count realizes the whole list, this seems like a bad way to test for empty on a lazy sequence.

state monad transformer

2009-02-16 Thread jim
Konrad, Here's a shot at implementing a monad transformer for the state monad. Any chance of getting it added to clojure.contrib.monads? (defn state-t [m] (monad [m-result (with-monad m (fn [v] (fn [s]

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread Rich Hickey
On Feb 16, 2009, at 5:35 PM, Mark Engelberg wrote: Browsing the source code for LazySeq, I noticed that isEmpty is implemented as follows: public boolean isEmpty() { return count() == 0; } Since count realizes the whole list, this seems like a bad way to test for empty on

Clojure on CLR/DLR

2009-02-16 Thread dmiller
[I thought I'd slip this in while Rich has everyone distracted lazy sequences.] What do you do when you love Lisp, are intrigued by Clojure, but have absolutely no projects at hand to test it out? Oh, and you have an interest in how dynamic languages are being implemented in modern virtual

Re: Newbie: Separating and grouping the elements in a bunch of vectors

2009-02-16 Thread Laurent PETIT
And to get the enclosing vector: (reduce conj [] (apply map vector [[:a :b] [1 2] ['a 'b]])) 2009/2/16 David Nolen dnolen.li...@gmail.com I'm sure it can be done, but it's not clear to me if you have a vector of vectors how Stuart's solution would work: 1:15 user= (map vector vecs)

Re: Clojure on CLR/DLR

2009-02-16 Thread Jeffrey Straszheim
Awesome! On Mon, Feb 16, 2009 at 5:43 PM, dmiller dmiller2...@gmail.com wrote: [I thought I'd slip this in while Rich has everyone distracted lazy sequences.] What do you do when you love Lisp, are intrigued by Clojure, but have absolutely no projects at hand to test it out? Oh, and you

Re: terminology question re: binding

2009-02-16 Thread Stuart Sierra
On Feb 16, 3:34 pm, Stuart Halloway stuart.hallo...@gmail.com wrote: Should I be using two different terms, or is the notion of binding   overloaded? I think it's overloaded. In Common Lisp, symbols are bound to values. Clojure's Vars are closer to CL symbols than Clojure symbols are to CL

Embed A Struct Within A Struct

2009-02-16 Thread Onorio Catenacci
Hi all, Is it possible to have a structure nested within a structure in Clojure? Consider the following code: (defstruct rect :height :width) (defstruct color-rect :color (struct rect)) (defn #^{:doc Echoes the details of the rect passed to it} echo-rect [r] (println (:color r)) (println

Re: Clojure on CLR/DLR

2009-02-16 Thread Chouser
On Mon, Feb 16, 2009 at 5:43 PM, dmiller dmiller2...@gmail.com wrote: The code will go up on clojure-contrib ASAP. I need input from the clojure-contrib project members on how they operate, where they want to put it, etc. I don't know if you've looked at ClojureScript at all, but it's a

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread kotor
I definitely support your second option; first / rest / next. In my mind, rest means collection of remaining items and should return a collection, and next will also do exactly what I would expect it to do. Clojure is sufficiently different from Common Lisp already that breaking the compatibilty

Is this a bug ?!?

2009-02-16 Thread redhotmonk
Ok, perhaps I'm just dumb, but I have the problem with the following code: (import '(java.util ArrayList Collections)) (defn shuffle-java Shuffles coll using a Java ArrayList. [coll] (let [l (ArrayList. coll)] (Collections/shuffle l) (seq l))) (defn- nodes-num [x-dim y-dim] (*

Re: Clojure on CLR/DLR

2009-02-16 Thread dmiller
On Feb 16, 5:33 pm, Chouser chou...@gmail.com wrote: On Mon, Feb 16, 2009 at 5:43 PM, dmiller dmiller2...@gmail.com wrote: I don't know if you've looked at ClojureScript at all, but it's a similar if noticeably less ambitious project to compile Clojure code to JavaScript. It's in

Re: Embed A Struct Within A Struct

2009-02-16 Thread samppi
You can nest structs in structs like this: (defstruct rect :height :width) (defstruct colored-rect :color :shape) (def subject (struct colored-rect :red (struct rect 50 30))) (println subject) ; prints {:color :red, :shape {:height 50, :width 30}} The defstruct macro takes a var and a bunch

Re: Newbie: Separating and grouping the elements in a bunch of vectors

2009-02-16 Thread samppi
Thanks a lot, everyone. Isn't (reduce conj [] (apply map vector [[:a :b] [1 2] ['a 'b]])) equivalent to (into [] (apply map vector [[:a :b] [1 2] ['a 'b]])) though? On Feb 16, 3:55 pm, Laurent PETIT laurent.pe...@gmail.com wrote: And to get the enclosing vector: (reduce conj [] (apply map

Re: Clojure on CLR/DLR

2009-02-16 Thread Rich Hickey
On Feb 16, 2009, at 7:17 PM, dmiller wrote: On Feb 16, 5:33 pm, Chouser chou...@gmail.com wrote: On Mon, Feb 16, 2009 at 5:43 PM, dmiller dmiller2...@gmail.com wrote: I don't know if you've looked at ClojureScript at all, but it's a similar if noticeably less ambitious project to

Is syntax quote reader only?

2009-02-16 Thread Brian Will
I'm a bit mystified how syntax quote does what it does. I don't see how syntax quote can quote the whole while unquoting parts without some evaluation-time intervention. If I had to implement it myself, I'd just punt the problem to evaluation-time by introducing a special form 'unquote', e.g.:

Re: How do I do this in clojure?

2009-02-16 Thread Mark Engelberg
Suggestion: Provide a statement of purpose as to what this function is supposed to do. What are its inputs and what is its output? Can you break it down into smaller functions? Right now you have a complicated function that takes no inputs and always produces the same string. It seems

Re: How do I do this in clojure?

2009-02-16 Thread GS
On Feb 17, 1:18 pm, Jesse Aldridge jessealdri...@gmail.com wrote: I'm trying to port some Python code to Clojure.  I'm new to functional programming and I hit a function that is causing my brain to melt. The python function looks something like this: [..] If someone could please

Re: How do I do this in clojure?

2009-02-16 Thread Jeffrey Straszheim
Minus the bad html, you'll want something like this: (defn make-table Make an html table n rows wide from collection col. [col n] (let [make-row (fn [row] (let [cont (map #(str td % /td) row)] (apply str tr (conj (vec cont) /tr cont (map

Re: Clojure on CLR/DLR

2009-02-16 Thread Rayne
Anything buy IronClojure. On Feb 16, 7:30 pm, Rich Hickey richhic...@gmail.com wrote: On Feb 16, 2009, at 7:17 PM, dmiller wrote: On Feb 16, 5:33 pm, Chouser chou...@gmail.com wrote: On Mon, Feb 16, 2009 at 5:43 PM, dmiller dmiller2...@gmail.com   wrote: I don't know if you've

Re: How do I do this in clojure?

2009-02-16 Thread Dan
On Mon, Feb 16, 2009 at 9:18 PM, Jesse Aldridge jessealdri...@gmail.comwrote: I'm trying to port some Python code to Clojure. I'm new to functional programming and I hit a function that is causing my brain to melt. The python function looks something like this: def build_table():

Re: Clojure on CLR/DLR

2009-02-16 Thread Dan
On Mon, Feb 16, 2009 at 11:15 PM, Rayne disciplera...@gmail.com wrote: Anything buy IronClojure. There's already an IronLisp anyway: http://www.codeplex.com/IronLisp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Newbie: Separating and grouping the elements in a bunch of vectors

2009-02-16 Thread Chouser
On Mon, Feb 16, 2009 at 7:54 PM, samppi rbysam...@gmail.com wrote: Thanks a lot, everyone. Isn't (reduce conj [] (apply map vector [[:a :b] [1 2] ['a 'b]])) equivalent to (into [] (apply map vector [[:a :b] [1 2] ['a 'b]])) though? Yes. --Chouser

Re: Clojure on CLR/DLR

2009-02-16 Thread Sean
David, You have a great idea here with porting clojure to the CLR. The .NET shops are just a popular as Java shops, and something like this could go a long way to improving software written by a lot of people. Your initiative and hard work are to be commended. How do you plan on solving the

Re: Clojure on CLR/DLR

2009-02-16 Thread dmiller
ClojureCLR it shall be. --dm On Feb 16, 7:30 pm, Rich Hickey richhic...@gmail.com wrote: I prefer ClojureCLR. Rich --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send

Re: How do I do this in clojure?

2009-02-16 Thread Timothy Pratley
I found this question interesting for two reasons: (1) A selected item has been specified which needs to be handled differently - at first glance suggests an iterative solution. (2) There is good support for html in clojure via libraries, so you should avoid string concatenation of tags. So

Re: Does this debugger feature exist?

2009-02-16 Thread Jason Wolfe
I'm sure SLIME has similar features (I've used them with SBCL) but I haven't managed to get them to work with Clojure yet -- my suspicion is that they're not implemented in swank-clojure yet -- although I'll admit I haven't tried too hard. -Jason On Feb 16, 11:38 pm, CuppoJava