Re: Best IDE

2012-01-20 Thread Norman Gray
Greetings. On 2012 Jan 20, at 01:26, Mark Nutter wrote: On Thu, Jan 19, 2012 at 11:42 AM, David Brunell quantal...@gmail.com wrote: How long did it take you to get comfortable with paredit? I keep getting frustrated and going back to manually matching parens. I had the same experience

Re: ClojureScript in IE 9 (does it work?)

2012-01-20 Thread gchristnsn
Thanks for the suggestions, I have created a wrapper function and it works, but it seems, there are more problems. I use reader/read-string function to parse clojure data structures sent as POST messages, and it doesn't recognize keywords in IE. For example, it treats {:status :ok} as

Re: ClojureScript in IE 9 (does it work?)

2012-01-20 Thread gchristnsn
I just have tried to replace all special characters in core.js to their escaped equivalents (\uFDD0 for keywords) and it works fine. But I still not certain where this bug comes from. On Jan 20, 12:56 pm, gchristnsn gchrist...@gmail.com wrote: Thanks for the suggestions, I have created a wrapper

Re: how to get font-lock to work in swank repl buffer

2012-01-20 Thread Daniel Janus
On Thursday, January 19, 2012 9:52:44 PM UTC, bsmith.occs wrote: Incidentally, what's with this strange form of let? (let (font-lock-mode) ;; - shouldn't this bind variables? (clojure-mode-font-lock-setup)) In Common Lisp (and presumably in Emacs Lisp as well), 'let' takes an

Pretty-print with metadata

2012-01-20 Thread Chris Perkins
Is there a way to pretty-print an object with its metadata? If I (set! *print-meta* true) at the REPL, I can see the metadata. If I use (pprint thing), I can see the structure much more easily. How can I do both? - Chris -- You received this message because you are subscribed to the Google

Re: Pretty-print with metadata

2012-01-20 Thread Meikel Brandmeyer (kotarak)
Hi, how about something like this? (defn pprint-with-meta [thing] (when (instanceof? IMeta thing) (print ^) (pprint (meta thing)) (print )) (pprint thing)) Sincerely Meikel -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: Pretty-print with metadata

2012-01-20 Thread Chris Perkins
Thanks Meikel. So I guess from your reply that there is no built-in way to do this, right? The objects I'm trying to inspect can be deeply nested maps and vectors, and I want to see all the metadata - not just on the root object. I guess I would have to either re-implement some of the logic

Re: ClojureScript in IE 9 (does it work?)

2012-01-20 Thread David Nolen
It would be helpful if you could investigate the precise problem if there is one and submit a JIRA ticket. On Friday, January 20, 2012, gchristnsn gchrist...@gmail.com wrote: Thanks for the suggestions, I have created a wrapper function and it works, but it seems, there are more problems. I

Re: Pretty-print with metadata

2012-01-20 Thread Meikel Brandmeyer (kotarak)
Hi, I don't know a built-in way. But that doesn't mean, that there isn't one. You could ask Tom Faulhaber directly. He did the pretty print stuff. Sincerely Meikel -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Pretty-print with metadata

2012-01-20 Thread Chris Perkins
By looking at pprint.clj, I have come up with something that seems to work. No hacking is necessary - the code in pprint is impressively clear and extensible. It's obviously designed to allow exactly this sort of extension to the printing mechanism. user (defn ppm [obj] (let

Re: Pretty-print with metadata

2012-01-20 Thread Meikel Brandmeyer (kotarak)
Cool. :) Good to hear, that things are working. Nice to have around. 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 Note that posts from new members are moderated - please be

Re: identical?

2012-01-20 Thread Gary Trakhman
Interning a string is caching it in a string pool that lives in the jvm's permgen space. Calling .intern() on a string either adds it to the pool or return the string object that's already in the pool. This is safe to do for strings that are defined statically, generally you don't want to

Re: Controlling the test environment

2012-01-20 Thread Daniel E. Renfer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/15/2012 06:18 PM, Matt Stump wrote: Is there a way to set different values for global vars when running tests as opposed to the development or production environment? I need to control which database my tests for a noir project connect

ANN: ClojureScript revision 927 release

2012-01-20 Thread Stuart Sierra
We have released JARs for ClojureScript to the Sonatype OSS repository. They will be uploaded to the Maven Central repository within 24 hours. We do not yet have any automated build/release cycle for ClojureScript. If you want to track the latest ClojureScript development, please continue to use

How to loop over several sequences in parallel for side-effects?

2012-01-20 Thread joachim
Hi All, Here is a simple problem for which I nevertheless can't seem to find the right solution: How to run over several sequences in parallel for side-effects? Here is one way: (dorun (map some-fn-with-side-effects sequence-1 sequence-2)) However, I was told that the form (dorun (map ...

Gist script

2012-01-20 Thread DAemon
Hey everyone, I've been playing around with Clojure, and came up with this little thing to allow you to easily pull scripts in from Gist and execute them. Thought it might be useful to someone! https://gist.github.com/1646223 - DAemon -- You received this message because you are subscribed to

Re: Best IDE

2012-01-20 Thread Dennis Peterson
That third trick works in standard vim when you type da(...except you don't have to be on the opening paren, you can be anyplace within the sexp (as long as you're not within a smaller sexp, in which case you'll get that one.) A couple quick macros can handle the other two. If those three are the

Re: Best IDE

2012-01-20 Thread Bill Allen
Agreed. I find paredit mode essential for any serious coding. That said, there are brief periods in which I find I like it off. On Jan 19, 2012 1:57 PM, Sean Corfield seancorfi...@gmail.com wrote: On Thu, Jan 19, 2012 at 9:07 AM, Laurent PETIT laurent.pe...@gmail.com wrote: I've tried paredit

Re: Best IDE

2012-01-20 Thread Neale Swinnerton
On Thu, Jan 19, 2012 at 2:37 PM, Maris maris.orbid...@gmail.com wrote: Emacs + Paredit is probably the best IDE. Nothing improves productivity like paredit. Hi, Hopefully you won't consider it too much self promotion ;-), but I gave brief (7 mins) lightning talk at the london clojure user

Documenting Clojure Design without UML

2012-01-20 Thread Adam Markham
I have always used UML to document the design of software projects I have worked on in object-oriented languages. I am now working on a Clojure project and am required to document the design so anyone reading these documents will understand the design of the software. I was wondering if there is

Re: strange problem

2012-01-20 Thread joachim
On Jan 18, 8:23 pm, Andy Fingerhut andy.finger...@gmail.com wrote: I don't have some code lying around to do that, but I might make one.  The name strings would require several megabytes of storage, but as long as you don't mind that... I wouldn't mind, but the code your provided is already

Re: Sorry Don't understand for macro, a bug or a newbie-question??

2012-01-20 Thread aschoerk
Ah, thank you, so a newbie question. But helped me a lot. Andreas On Jan 18, 10:26 pm, Jack Moffitt j...@metajack.im wrote: doesn't show any effect of the for. The only difference is the additional statement at the end. I can not imagine how this statement sequentially behind can

Re: lein-cljsbuild 0.0.1 released

2012-01-20 Thread Evan Mezeske
I find the idea of using a special filename extension rather appealing. A couple of notes: (1) I'm not sure there is a generic clojure. ClojureScript has a couple serious differences from Clojure, such as the way macros are included in (ns ...). (2) ClojureScript macro files, AFAICT, really

Re: Best IDE

2012-01-20 Thread Joseph Smith
emacs. :D Seriously though, start with viper-mode. --- Joseph Smith j...@uwcreations.com (402)601-5443 On Jan 18, 2012, at 1:35 PM, Jeb Beich wrote: Any suggestions for a vim man? On Wed, Jan 18, 2012 at 1:29 PM, Cedric Greevey cgree...@gmail.com wrote: On Wed, Jan 18, 2012 at 11:18

Seemingly simple shell commands taking forever

2012-01-20 Thread techwhizbang
I am using lein run -m to execute a simple database preparation task. I issue 2 very simple commands that execute very fast on their on own when executed in the shell. They also appear to execute very fast based on the print output to stdout. However, the problem is that after executing the 2

Re: ANN: ClojureScript revision 927 release

2012-01-20 Thread David Nolen
Sweet! On Fri, Jan 20, 2012 at 2:14 PM, Stuart Sierra the.stuart.sie...@gmail.comwrote: We have released JARs for ClojureScript to the Sonatype OSS repository. They will be uploaded to the Maven Central repository within 24 hours. We do not yet have any automated build/release cycle for

Re: How to loop over several sequences in parallel for side-effects?

2012-01-20 Thread Lars Nilsson
On Fri, Jan 20, 2012 at 8:18 AM, joachim joachim.de.be...@gmail.com wrote: Hi All, Here is a simple problem for which I nevertheless can't seem to find the right solution: How to run over several sequences in parallel for side-effects? Here is one way:     (dorun (map

Re: Documenting Clojure Design without UML

2012-01-20 Thread Paulo Pinto
Hi, I think your problem is more general than just Clojure. Actually there was a long discussion on the Functional Programming group over at LinkedIn about applying UML to functional languages. The general consensus is that you can somehow adapt UML concepts to describe data structures and

Re: ANN: ClojureScript revision 927 release

2012-01-20 Thread pmbauer
Weekend made. Thank you! -- 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 post. To unsubscribe from this

Re: Best IDE

2012-01-20 Thread Alex Baranosky
I say just to use whichever environment you like most. I use Intellij. And its all good. Ctrl-w to grab matching parens. Ctrl-shift up/down to move lines of code. Etc... What I'm saying is that most modern tools can generally get you where you want to go, so pick what you are comfortable with.

Re: how to get font-lock to work in swank repl buffer

2012-01-20 Thread Ben Smith-Mannschott
On Fri, Jan 20, 2012 at 00:45, Jack Moffitt j...@metajack.im wrote: (add-hook 'slime-repl-mode-hook               (lambda ()                 (clojure-mode-font-lock-setup)                 (font-lock-mode)                 (font-lock-mode))) Excellent! This worked for me. Many thanks for the

Re: How to loop over several sequences in parallel for side-effects?

2012-01-20 Thread Meikel Brandmeyer
Hi, to add to Lars answer: (doseq [[a b c] (map vector s1 s2 s3)] (side-effect-fn a b c)) This should do the trick. Sincerely 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

Re: How to loop over several sequences in parallel for side-effects?

2012-01-20 Thread Steve Miner
On Jan 20, 2012, at 2:41 PM, Lars Nilsson wrote: = (map #(vector %1 %2) [1 2 3] ['a 'b 'c]) ([1 a] [2 b] [3 c]) Sorry if I'm drifting a bit off topic, but I just wanted to point out that it's convenient to use just the function name if the arguments are already in the appropriate order.

Re: How to loop over several sequences in parallel for side-effects?

2012-01-20 Thread Alan Malloy
But I don't see any reason why this would be faster than (dorun (map side-effect-fn s1 s2 s3)). You're creating and then dismantling a three-element vector at every iteration to no purpose. On Jan 20, 12:40 pm, Meikel Brandmeyer m...@kotka.de wrote: Hi, to add to Lars answer: (doseq [[a b c]

Re: Pretty-print with metadata

2012-01-20 Thread Cedric Greevey
Yeah, but it won't quite work if even the metadata has metadata. user= (def x (with-meta {:b 1} (with-meta {:a 1} {:x 1}))) #'user/x user= x {:b 1} user= (meta x) {:a 1} user= (meta (meta x)) {:x 1} The code above would leave out the metadata {:x 1} on {:a 1}, though it should display the

Re: Seemingly simple shell commands taking forever

2012-01-20 Thread Phil Hagelberg
techwhizbang techwhizb...@gmail.com writes: I am using lein run -m to execute a simple database preparation task. I issue 2 very simple commands that execute very fast on their on own when executed in the shell. They also appear to execute very fast based on the print output to stdout.

Re: topoged-hibernate 1.0.0

2012-01-20 Thread Matthew O. Smith
On Jan 6, 8:20 am, Bill Robertson billrobertso...@gmail.com wrote: On Jan 3, 4:26 pm, Matthew O.  Smith m0sm...@gmail.com wrote: There is a mismatch between hibernate maps and clojure maps which means that there is some translating between them. Hopefully, this will be smoothed over in

Re: Pretty-print with metadata

2012-01-20 Thread Chris Perkins
Good catch! I was about to add this to my personal toolkit of generally useful random crap (every programmer has one of those, right?). I'll make sure to cover that edge-case. Thanks. - Chris -- You received this message because you are subscribed to the Google Groups Clojure group. To

Re: Clojurescript One: distinguishing event sources / multiple widget instances

2012-01-20 Thread kovas boguta
Hi David, Setting aside the data binding aspect of the problem for a minute.. jQuery, Dojo and other JS libs seem to be going all-in on the event delegation paradigm. The idea is: instead of binding event handlers to each individual instance, you let the events bubble up to the top of the

Re: Clojurescript One: distinguishing event sources / multiple widget instances

2012-01-20 Thread David Nolen
On Fri, Jan 20, 2012 at 6:06 PM, kovas boguta kovas.bog...@gmail.comwrote: Hi David, Setting aside the data binding aspect of the problem for a minute.. jQuery, Dojo and other JS libs seem to be going all-in on the event delegation paradigm. Yup event delegation is definitely the way to

Re: active jQuery ticket for ADVANCED_OPTIMIZATIONS

2012-01-20 Thread Dave Sann
nice! -- 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 post. To unsubscribe from this group, send email to

confusing macro issue: java.lang.InstantiationException

2012-01-20 Thread drewn
I've been trying to write a macro to generate predicates from maps, for instance the map {1 :one 2 :two} would define two predicates, one? and two? Here's the first part of the macro: (defmacro make-predicate [keyword-pair] `(defn ~(symbol (str (name (nth (eval keyword-pair) 1)) ?)) [~'x]

Re: clojure-clr loadpath points to D: harddrive

2012-01-20 Thread dmiller
It shouldn't, obviously. It appears to be holding on to a compile- time value somewhere. I'll track it down this weekend. -David On Jan 19, 10:25 pm, jayvandal s...@ida.net wrote: Why does the clr point to d: work? user= (use :reload 'ui) FileNotFoundException Could not locate

clooj ot seeing output

2012-01-20 Thread jayvandal
I aam trying hello-seesaw tutorial in clooj. I don't see output or screens as in running Leiningen. I trie adding all the commands and didn't see any output, so I went back line by line and can't see any screens. What commands should I be using to see progres? I am still trying to write

Re: confusing macro issue: java.lang.InstantiationException

2012-01-20 Thread Cedric Greevey
On Fri, Jan 20, 2012 at 9:54 PM, drewn naylor...@gmail.com wrote: I've been trying to write a macro to generate predicates from maps, for instance the map {1 :one 2 :two} would define two predicates, one? and two? What's the use case for this? (def one? #{1}) (def two? #{2}) isn't much

Re: confusing macro issue: java.lang.InstantiationException

2012-01-20 Thread drewn
Thank you, that works great! It's a nice use of destructuring too, which I should of thought of. I guess this is one case where solving the problem in pieces does not help. Actually, I seem to remember seeing idioms like that for other macros over sequences. I understand a little more now why.