Re: Best practice - (:keyword map) versus (map :keyword)

2013-01-29 Thread David Powell
Generally, if the map is behaving like small struct, and you are accessing fields of it, (:keyword map) is idiomatic, and mirrors (.fields object). If the map is used like a data-structure, or a mapping function, then (map :keyword) is more idiomatic. Note that if you are using defrecords, (:keywo

Re: Best practice - (:keyword map) versus (map :keyword)

2013-01-29 Thread Laurent PETIT
a) If your map represents an "record" with "fields" (for instance if it would make sense to also represent it as record via defrecord), then use (:field map) b) If your map is a collection of key/vals, then use (map key) Rationale for a): it will allow better migration path if you use defrecords

clojure.tools.logging / log4j / lein2

2013-01-29 Thread Stuart Campbell
Hello, I'm working on a library that uses clojure.tools.logging, and I'm using Leiningen 2 to build it. If I include log4j in my project's :dev-dependencies, I get weird logging output, e.g.: Jan 29, 2013 8:45:31 PM clojure.tools.logging$eval373$fn__377 invoke INFO: Hello But if I include log4j

Re: Best practice - (:keyword map) versus (map :keyword)

2013-01-29 Thread Meikel Brandmeyer (kotarak)
For completeness sake... Am Dienstag, 29. Januar 2013 10:31:18 UTC+1 schrieb lpetit: > > Rationale for b): you have an existing map, but the key may or may not > be present. Note that you can also use the version which returns > default value if there's no key in the map: (map key default-value)

Re: clojure.tools.logging / log4j / lein2

2013-01-29 Thread Stuart Campbell
Hmm, perhaps I should RTFM. Apparently :dev-dependencies no longer exists in lein2. Adding this to my project.clj resolves the issue: :profiles {:dev {:dependencies [[log4j "1.2.17"]]}} On 29 January 2013 21:24, Stuart Campbell wrote: > Hello, > > I'm working on a library that uses clojure.too

ANN: nio 0.0.4

2013-01-29 Thread Paul Stadig
Wanted to let everyone know that I've released nio 0.0.4 on Clojars. nio is a library that extends clojure.java.io support to the java.nio classes. The 0.0.4 release adds two convenience functions for reading and setting the byte order of ByteBuffers. You can find out details and example usage at h

parallel dynamic-programing?

2013-01-29 Thread Jim foo.bar
Hi all, I realise this may be a slightly naive question and my implementation is certainly naive, however I'd like to see if anyone else has attempted anything similar. Of course, by 'dynamic-programming' I 'm not referring to dyncamic scope but to the statistical technique which divides prob

Re: Best practice - (:keyword map) versus (map :keyword)

2013-01-29 Thread Christophe Grand
You have 3 choices, all supporting a -n optional default value: 1. (:kw m), 2. (m :kw), 3. (get m :kw) If your keyword is literal, always pick #1. So if your keyword is not literal then you are left with either (m x) or (get m x) -- remember x is not litteral. The later version will work with map

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Feng Shen
I have programming Clojure for almost 2 years, for a living. Emacs is highly recommended. Emacs Lisp => lisp, Clojure is also Lisp. Emacs has special support for Lisp than others. As for intellj: I think it's quite good. Emacs is the perfect one. On Monday, January 28, 2013 7:37:54 PM UTC+8

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Jay Fields
On Tue, Jan 29, 2013 at 9:28 AM, Feng Shen wrote: > I have programming Clojure for almost 2 years, for a living. > This is probably an important part of what answer the OP is looking for. When I was doing Clojure for about 10% of my job IntelliJ was fine. Now that it's 90% of my job, I wouldn't b

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Laurent PETIT
Hello Jay, I'd like to learn a little bit more from what makes you prefer emacs over IntelliJ. As the main developer of Counterclockwise, I'm I could learn some ideas, if not lessons, from your experience. Some questions and remarks inline: 2013/1/28 Jay Fields : > I used IntelliJ for clojure de

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Dennis Haupt
i don't know emacs, so i would like to know as well what the killer features are that make you more productive with emacs 2013/1/29 Laurent PETIT > Hello Jay, > > I'd like to learn a little bit more from what makes you prefer emacs > over IntelliJ. > As the main developer of Counterclockwise, I

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Charlie Griefer
On Jan 29, 2013, at 9:50 AM, Dennis Haupt wrote: > i don't know emacs, so i would like to know as well what the killer features > are that make you more productive with emacs With the caveat that I've not used Eclipse or IntelliJ for Clojure development… one thing that I _really_ like about Em

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Rich Morin
On Jan 29, 2013, at 08:50, Dennis Haupt wrote: > i don't know emacs, so i would like to know as well what the killer features > are that make you more productive with emacs Me two. More generally, I'm interested in features that DON'T require filling my head with zillions of obscure key sequences

clojure API documentation

2013-01-29 Thread cej38
Hello, I have noticed a couple of things that I think are standard Clojure symbols but that aren't specified in the API documentation. These are "." and "_". It may be that they are more Java than Clojure (I don't know Java at all) and are thus supposedly known. I run across "_" all of the

Re: clojure API documentation

2013-01-29 Thread Stathis Sideris
_ is not special, but it is the convention to use it as the name for variables whose value is ignored. On Tuesday, 29 January 2013 17:42:26 UTC, cej38 wrote: > > Hello, > I have noticed a couple of things that I think are standard Clojure > symbols but that aren't specified in the API document

Re: clojure API documentation

2013-01-29 Thread Michael Gardner
On Jan 29, 2013, at 11:42 , cej38 wrote: > Should these symbols be added to the documentation? The dot is documented at http://clojure.org/java_interop#dot -- which you'll be pointed to if you try (doc .) at a repl. It's also linked from http://clojure.org/special_forms. It's not in the API

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Softaddicts
I worked with one of the first version of Emacs written in Teco on a DEC-20 in the 80s then on unixes and VMS computer. I still remember some key bindings but I need to resort to online help a lot to bring back key bindings in my working memory. We use Eclipse/ccw but I think that the same reaso

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Jay Fields
On Tue, Jan 29, 2013 at 11:45 AM, Laurent PETIT wrote: > Hello Jay, > > I'd like to learn a little bit more from what makes you prefer emacs > over IntelliJ. > As the main developer of Counterclockwise, I'm I could learn some > ideas, if not lessons, from your experience. Sure, responses inline-

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Jay Fields
Rich, almost all keystrokes have names you can use from M-x - if you prefer that to keystrokes. On Tue, Jan 29, 2013 at 11:59 AM, Rich Morin wrote: > On Jan 29, 2013, at 08:50, Dennis Haupt wrote: >> i don't know emacs, so i would like to know as well what the killer features >> are that make you

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Josh Kamau
Question: Is this emacs also good in other stuff such as javascript/css/html/sql Most of my projects involve writing this as well . Does anyone have a link to an up to date instructions on how to setup emacs for clojure ? most of what i find are out of date... e.g some talk of swank-clojure

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Timo Mihaljov
On 29.01.2013 16:32, Jay Fields wrote: > On Tue, Jan 29, 2013 at 9:28 AM, Feng Shen wrote: >> I have programming Clojure for almost 2 years, for a living. >> > > This is probably an important part of what answer the OP is looking > for. When I was doing Clojure for about 10% of my job IntelliJ wa

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Jay Fields
I use it for Clojure, html, css, & js - no sql tho, so I can't comment on that. Otherwise, everything is great. I use emacs-live, which you can add to a vanilla emacs install and get right started. All you need to nrepl-jack-in. On Tue, Jan 29, 2013 at 1:21 PM, Josh Kamau wrote: > Question: Is t

Re: Blog Post: "The Magic of Macros: Lighting-Fast Templating in ClojureScript"

2013-01-29 Thread Aria Haghighi
Thanks! Chris' protocol commit was very good. Made the runtime stuff faster and extensible. On Saturday, January 26, 2013 4:29:56 PM UTC-8, Curtis Gagliardi wrote: > > Great use of macros, and I found Chris Granger's protocol commit > enlightening as well, thanks. > > On Tuesday, January 22, 201

Prismatic Plumbing and Graph Open-Source Release

2013-01-29 Thread Aria Haghighi
Hey all, Prismatic has open-sourced our Plumbing and Graph library on github. Jason Wolfe gave a talkabout how we use graph for systems composition at Strange loop last ye

Re: Exception in thread "Thread-4" java.lang.NoClassDefFoundError:

2013-01-29 Thread larry google groups
> do you mean this happens from the beginning, or only after ie. 10 minute of > running it(I mean, it only breaks down after a while) > also, is this code on github? Yes, the app runs for a while. Sometimes it runs for only 10 minutes. Other times it runs for an hour. But then, eventually, thi

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Josh Kamau
Thanks Jay... Emacs live looks funtastic... I will give emacs another try. Josh On Tue, Jan 29, 2013 at 9:48 PM, Jay Fields wrote: > I use it for Clojure, html, css, & js - no sql tho, so I can't comment > on that. Otherwise, everything is great. > > I use emacs-live, which you can add to a van

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread László Török
+1 emacs live Id seriously discourage any Emacs newbie trying vanilla Emacs for Clojure development. Here, I'd also like to express my greatest appreciation to the creators for publishing and maintaining it. Las Sent from my phone On Jan 29, 2013 7:48 PM, "Jay Fields" wrote: > I use it for Clo

Re: Exception in thread "Thread-4" java.lang.NoClassDefFoundError:

2013-01-29 Thread larry google groups
> unless the error happens at runtime after a while when you're sure that > code already got executed and worked, but only errs after a while, > in which case that would be weird. That seems to be what happens. I am glad you think it is weird because I found it very weird. I am reaching for s

Re: Exception in thread "Thread-4" java.lang.NoClassDefFoundError:

2013-01-29 Thread larry google groups
> It might be something like this(pasting here): > The problem is the hyphen in the namespace. I think that causes problems at compile time, rather than runtime, but there is a chance you are right, so I will go through and carefully change all hyphens to underscores in all namespace declarat

Re: Prismatic Plumbing and Graph Open-Source Release

2013-01-29 Thread László Török
Graph was THE library I've been waiting for to be open sourced! Yay, thanks! Las Sent from my phone On Jan 29, 2013 7:57 PM, "Aria Haghighi" wrote: > Hey all, > > Prismatic has open-sourced our Plumbing and Graph library on > github. > Jason Wolfe gave

do background threads sometimes swallow exceptions?

2013-01-29 Thread larry google groups
I think someone on this mailist recently said that an exception that occurs in a thread is sometimes lost? That is, even if I put in a lot of pprint statements or println statements* or (stack/print-stack-trace e) expressions, and I just want it to show up in terminal, so I can debug it, but if

screencast: friend and creating a login form

2013-01-29 Thread Nelson Morris
I've released a screencast on friend and using its interactive-form workflow to create a login form. http://www.clojurewebdevelopment.com/videos/friend-interactive-form I've got more in various stages of completion, so I'd be interested in hearing feedback. Thanks, Nelson Morris -- -- You rece

Re: Is there a performance hit when dynamically "require"-ing namespaces

2013-01-29 Thread Sean Bowman
Perfect. Not really a problem with multiple calls to require: I run through the list when the app starts up, require each ns, then each ns calls its own "start" function at the end to configure the required hooks--all event-driven. It's never "required" again. Thanks! On Wednesday, January

Re: Is there a performance hit when dynamically "require"-ing namespaces

2013-01-29 Thread Laurent PETIT
2013/1/23 Sean Corfield : > On Wed, Jan 23, 2013 at 12:13 AM, Mikera wrote: >> It requires the compilation of the namespace when it is loaded the first >> time, but that isn't particularly bad and is only a one-off cost. If you >> require the plugin twice then the second time is effectively a no-o

Re: do background threads sometimes swallow exceptions?

2013-01-29 Thread larry google groups
>I don't see any threads in your Stack Overflow post. I thought it would be over-complicated to include all of the code. But inside my -main function I start a new thread and call the function that calls the function that causes this error. >They are not "lost". Unhandled exceptions cause >

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Phil Hagelberg
Jay Fields writes: > On Tue, Jan 29, 2013 at 11:45 AM, Laurent PETIT > wrote: >> Hello Jay, >> >> I'd like to learn a little bit more from what makes you prefer emacs >> over IntelliJ. >> As the main developer of Counterclockwise, I'm I could learn some >> ideas, if not lessons, from your exper

Re: do background threads sometimes swallow exceptions?

2013-01-29 Thread Chas Emerick
On Jan 29, 2013, at 4:56 PM, Michael Klishin wrote: > > 2013/1/30 larry google groups > That is good to know. I have the top level function call wrapped in a > try/catch block, but I suppose I'll get better results if I do more of the > try/catch at a lower level, closer to the problem. > > W

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Dennis Haupt
Am 29.01.2013 23:05, schrieb Phil Hagelberg: > > Jay Fields writes: > >> On Tue, Jan 29, 2013 at 11:45 AM, Laurent PETIT >> wrote: >>> Hello Jay, >>> >>> I'd like to learn a little bit more from what makes you prefer emacs >>> over IntelliJ. >>> As the main developer of Counterclockwise, I'm I

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Sean Corfield
On Tue, Jan 29, 2013 at 2:21 PM, Dennis Haupt wrote: > you can do repl driven development with intellij as well i think. I'm pretty sure Phil meant you can modify your editor (Emacs) using a REPL-driven approach - which is not true of IntellIj. -- Sean A Corfield -- (904) 302-SEAN An Architect's

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Rich Morin
On Jan 29, 2013, at 14:05, Phil Hagelberg wrote: > While it's great to list features, the specific features really aren't > the point--the point is that new features can be added with very little > friction. ... This begs the question: what would be the lowest amount of friction that we should try

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Jay Fields
I could define repl driven development in a lot of ways. If I'm in a clj file is there an easy way to evaluate a sexp in the context of the repl? Just having a repl that I cut and paste from is not a similar experience. Sent from my iPhone On Jan 29, 2013, at 5:21 PM, Dennis Haupt wrote: > Am 2

Re: Is there a performance hit when dynamically "require"-ing namespaces

2013-01-29 Thread Sean Corfield
On Tue, Jan 29, 2013 at 1:39 PM, Laurent PETIT wrote: > 2013/1/23 Sean Corfield : >> I recall a thread recently that said 'require' hits the disk every >> time, even if the ns is already loaded. Did that get fixed and, if so, >> when? > > Yes, fixed in RC2 (at least): Nice. My web framework FW/1

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Lee Spector
On Jan 29, 2013, at 5:28 PM, Rich Morin wrote: > > This begs the question: what would be the lowest amount of friction that > we should try for? One answer, it seems to me, is that there should be > an easy way to add features _using Clojure_. I realize that this would > not be a general soluti

Re: Prismatic Plumbing and Graph Open-Source Release

2013-01-29 Thread Tim Visher
On Tue, Jan 29, 2013 at 2:16 PM, László Török wrote: > Graph was THE library I've been waiting for to be open sourced! > > Yay, thanks! +1 to that! Thanks so much! -- In Christ, Timmy V. http://blog.twonegatives.com/ http://five.sentenc.es/ -- Spend less time on mail -- -- You received thi

Re: Prismatic Plumbing and Graph Open-Source Release

2013-01-29 Thread ronen
Amazing work Prismatic team, is there a plan to release Flop? http://lanyrd.com/2012/clojurewest/spdfg/ Thanks! Ronen On Tuesday, January 29, 2013 8:46:54 PM UTC+2, Aria Haghighi wrote: > > Hey all, > > Prismatic has open-sourced our Plumbing and Graph library on > github

Re: Prismatic Plumbing and Graph Open-Source Release

2013-01-29 Thread Aria Haghighi
Yes, we'll be releasing flop soon. On Tuesday, January 29, 2013 4:49:45 PM UTC-8, ronen wrote: > > Amazing work Prismatic team, is there a plan to release Flop? > > http://lanyrd.com/2012/clojurewest/spdfg/ > > Thanks! > Ronen > > On Tuesday, January 29, 2013 8:46:54 PM UTC+2, Aria Haghighi wrote

Re: Prismatic Plumbing and Graph Open-Source Release

2013-01-29 Thread ronen
Great! Thanks again Ronen On Wednesday, January 30, 2013 2:53:06 AM UTC+2, Aria Haghighi wrote: > > Yes, we'll be releasing flop soon. > > On Tuesday, January 29, 2013 4:49:45 PM UTC-8, ronen wrote: >> >> Amazing work Prismatic team, is there a plan to release Flop? >> >> http://lanyrd.com/201

Re: Installing Clojure on Windows 7

2013-01-29 Thread George Oliver
> On Thursday, January 24, 2013 12:56:59 PM UTC-5, > sampso...@googlemail.comwrote: >> >> Apparently installing a development environment for Clojure on Windows 7 >> is very difficult. What is the best way, that has a chance that it might >> work? >> > I just wanted to repeat the link that P

[ANN] nrepl.el 0.1.6 released

2013-01-29 Thread Tim King
I am pleased to announce that nrepl.el v0.1.6 has been released, and is now available on marmalade. Preview versions of the next release are available on Melpa. See the Readme on github (https://github.com/kingtim/nrepl.el) for installation and usage instructions. Notable changes since our last r

why did lein just download Clojure 1.5?

2013-01-29 Thread larry google groups
Very strange. I just switched back to my home computer. I wanted to get all the work I had done at work this last week, so I did "git pull origin master" to pull it down from github. I have not used my home computer in a week. Then I ran "lein uberjar": lein uberjar Retrieving org/clojure/clojure/

Re: why did lein just download Clojure 1.5?

2013-01-29 Thread AtKaaZ
just guessing here, but is it maybe that one of the deps of your project was (also?) updated and it's using that clojure ? I'm thinking just in case you have something like version x.y.z-SNAPSHOT of a dep, if nothing with SNAPSHOT then it's probably not the case. I couldn't reproduce this with a ne

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Laurent PETIT
2013/1/29 Rich Morin : > On Jan 29, 2013, at 14:05, Phil Hagelberg wrote: >> While it's great to list features, the specific features really aren't >> the point--the point is that new features can be added with very little >> friction. ... > > This begs the question: what would be the lowest amount

Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread Laurent PETIT
2013/1/29 Jay Fields : > I could define repl driven development in a lot of ways. If I'm in a > clj file is there an easy way to evaluate a sexp in the context of the > repl? Just having a repl that I cut and paste from is not a similar > experience. Of course CCW does that for years: - Ctlr+Enter

Re: why did lein just download Clojure 1.5?

2013-01-29 Thread Alan Malloy
`lein deps :tree` will show you the tree of dependencies, and you can see which of your dependencies has a bad dependency specification overriding the one in your project.clj. Typically it turns out a dependency is saying something like "I must have the very latest Clojure, whatever that is", w

*read-eval* vulnerability

2013-01-29 Thread Takahiro Hozumi
As more and more projects are using edn format for config, communication and etc, I think that default value of *read-eval*, which is true, is source of vulnerability such as recently reported ring issue [1]. And I don't understand why read-string depends on *read-eval* instead of argument. I belie

Re: why did lein just download Clojure 1.5?

2013-01-29 Thread Meikel Brandmeyer (kotarak)
Hi, Am Mittwoch, 30. Januar 2013 07:54:36 UTC+1 schrieb Alan Malloy: > > `lein deps :tree` will show you the tree of dependencies, and you can see > which of your dependencies has a bad dependency specification overriding > the one in your project.clj. Typically it turns out a dependency is sayi

Re: why did lein just download Clojure 1.5?

2013-01-29 Thread Sean Corfield
Try: lein deps :tree It sounds like one of your dependencies uses ranges? Sean On Tue, Jan 29, 2013 at 9:16 PM, larry google groups wrote: > Very strange. I just switched back to my home computer. I wanted to > get all the work I had done at work this last week, so I did "git pull > origin