Re: [ANN] Carmine (Redis client) v2, Nippy (serializer) v2 are out

2013-07-23 Thread Peter Taoussanis
Thanks Las, much appreciated! Just shout if there's anything I can assist with. - Peter -- -- 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 -

anaphoric macro?

2013-07-23 Thread eliassonaand
Hi, I want to write a macro that introduces new variables from data. The data is a vector and looks like this for example: [a b c] I want to use the macro like this: (def-names [a b c] (str a b)) What code I want the macro to produce from the above is the following: (let [a a b b c

Re: anaphoric macro?

2013-07-23 Thread Baishampayan Ghose
Since the bindings are a function of the data that's passed in, IMO you don't need a anaphoric macro for this. For example - (defmacro def-names [names body] (let [bindings* (vec (mapcat (juxt symbol identity) names))] `(let ~bindings* ~@body))) As to whether it's a good idea or

Re: anaphoric macro?

2013-07-23 Thread Alex Baranosky
Hi Anders, (defmacro def-name [name-vec body] `(let ~(vec (interleave (map symbol name-vec) name-vec)) ~@body)) user= (macroexpand '(def-name [a b c] 1 2 3)) (let* [a a b b c c] 1 2 3) user= (def-name [a b c] a) a user= (def-name [a b c] b) b user= (def-name

Re: anaphoric macro?

2013-07-23 Thread Alex Baranosky
Good point BG, I think it is almost certainly not a good idea :) But educational, definitely. On Tue, Jul 23, 2013 at 12:48 AM, Baishampayan Ghose b.gh...@gmail.comwrote: Since the bindings are a function of the data that's passed in, IMO you don't need a anaphoric macro for this. For

Re: Interest in a Full Featured Clojure Blog Engine

2013-07-23 Thread Manuel Paccagnella
Il giorno martedì 23 luglio 2013 03:32:52 UTC+2, frye ha scritto: On Sun, Jul 21, 2013 at 5:16 PM, Manuel Paccagnella manuel.pa...@gmail.com javascript: wrote: - what I should use to model workflow; possibly laminahttps://github.com/ztellman/lamina ? I'm not sure Lamina

Re: Interest in a Full Featured Clojure Blog Engine

2013-07-23 Thread Manuel Paccagnella
Il giorno martedì 23 luglio 2013 04:11:48 UTC+2, frye ha scritto: Hey all, *A)* Thanks for all the feedback on this topic. There's a few interesting things here. Notably that there are at least these existing blog engines: - http://github.com/bitemyapp/neubite (apparently needs a

Re: anaphoric macro?

2013-07-23 Thread Chris Ford
I use a similar macro in my music codehttps://github.com/ctford/leipzig/blob/master/src/leipzig/scale.clj, because I want to take a sequence and explicitly give parts of it names. (defmacro defs [names docstring values] `(do ~@(map (fn [name value] `(def ~name ~docstring ~value))

Re: Socket.IO and Clojure?

2013-07-23 Thread Ustun Ozgur
A bit off-topic, but in some situations where bidirectional communication is not necessary, one might consider EventSource instead of Websockets to push data from server to the client. For some reason, EventSource is not as well known as Websockets. It has some advantages like being more

Re: Making RPCs with Shoreleave

2013-07-23 Thread Tony Garcia
Hi, I'm using Shoreleave in one of our projects and it works fine for us. I followed the same tutorial and everything was OK. I've seen something similar when I was using the autogeneration of the js file. For some reason after updating the cljs the continuous compilation breaks the

futures - The Joy Of Clojure book question

2013-07-23 Thread Ryan Moore
There is an example in the book The Joy of Clojure on p.262 that uses futures that I evaluated in the REPL. user (time (let [x (future (do (Thread/sleep 2000) (+ 1 1)))] [@x @x])) Elapsed time: 2000.809 msecs [2 2] I figured that taking out the future would cause the execution to

Re: futures - The Joy Of Clojure book question

2013-07-23 Thread Baishampayan Ghose
It's definitely got to do with the code, the right way to test it out will be to wrap the form in a function and then calling it twice. Like so - (time (let [x (fn [] (Thread/sleep 2000) (+ 1 1))] [(x) (x)])) ;= Elapsed time: 4002.0 msecs ;= [2 2] Hope that helps.

Re: futures - The Joy Of Clojure book question

2013-07-23 Thread Lars Nilsson
On Tue, Jul 23, 2013 at 11:12 AM, Baishampayan Ghose b.gh...@gmail.com wrote: It's definitely got to do with the code, the right way to test it out will be to wrap the form in a function and then calling it twice. Like so - (time (let [x (fn [] (Thread/sleep 2000) (+ 1

Can we please deprecate the :use directive ?

2013-07-23 Thread Greg
I think I read somewhere that :use is no longer encouraged, but I could be mistaken. From what I've read, it seems like most people agree that Clojure has too many ways of including/importing/referencing/requiring/using things:

Re: Can't get namespace metadata

2013-07-23 Thread Stuart Sierra
I can confirm this behavior. It's not the fault of the `ns` macro, however. This works just fine: user= (ns ^{:doc This is foo} foo) nil foo= (in-ns 'user) #Namespace user user= (meta (the-ns 'foo)) {:doc This is foo} AOT-compilation appears to be the culprit (as usual).

Re: Can't get namespace metadata

2013-07-23 Thread Alexander Yakushev
Thank you for confirming this, Stuart. Hopefully this will be fixed someday. On Tuesday, July 23, 2013 7:06:18 PM UTC+3, Stuart Sierra wrote: I can confirm this behavior. It's not the fault of the `ns` macro, however. This works just fine: user= (ns ^{:doc This is foo} foo) nil

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Jozef Wagner
+1, :use is IMO an antipattern. I hate it mainly in blogs, where they explain some new API. They :use like 3 namespaces and you have to guess which fn is from which ns :) JW On Tuesday, July 23, 2013 5:50:50 PM UTC+2, Greg Slepak wrote: I think I read somewhere that :use is no longer

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Gary Trakhman
We should scour clojuresphere for uses of 'use' and automatically post github issues to the projects of interest, and redefine the ns macro to issue a warning with use. Does anyone actually like 'use'? Require is always more evident. On Tue, Jul 23, 2013 at 2:17 PM, Jozef Wagner

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Lee Spector
On Jul 23, 2013, at 2:27 PM, Gary Trakhman wrote: We should scour clojuresphere for uses of 'use' and automatically post github issues to the projects of interest, and redefine the ns macro to issue a warning with use. Does anyone actually like 'use'? Require is always more

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Softaddicts
We have production code using it. It's easy to say that it's a bad pattern after the fact. We have been using it in a disciplined way. It simplifies our life in the REPL we have some tools we want to see included automatically each time we switch to a name space. Anything else aside from

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Steven Degutis
For much the same reason, I've been using :require with :as and a one-or-two-letter alias, so I can do x/whatever. Generally works well. On Tue, Jul 23, 2013 at 1:38 PM, Lee Spector lspec...@hampshire.edu wrote: On Jul 23, 2013, at 2:27 PM, Gary Trakhman wrote: We should scour

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Sean Corfield
We only have :use in a couple of legacy tests and two scratch projects. We've switched from :use to :require .. :refer :all for situations where :use used to make sense (primarily in a test ns where we want to just refer in all of the ns being tested). We have a handful of places where we :refer

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Cedric Greevey
:use...:only doesn't strike me as especially problematic, since it documents the specific symbols it's importing and from where. On Tue, Jul 23, 2013 at 3:04 PM, Sean Corfield seancorfi...@gmail.comwrote: We only have :use in a couple of legacy tests and two scratch projects. We've switched

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Gary Trakhman
Yea, I have a single namespace with project-specific common utilities which I refer to as u/some-util-function. For me, it's a bit scary to have implicit symbols in scope. A typo can make a local binding refer to something that might not exist in production, or at least not what's intended.

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Gary Trakhman
What's problematic about it is that it's slightly easier to do the wrong thing. It seems insignificant, but 98% of times you use use, it's going to be wrong. Also, 'use only' means I have to change my calling NS twice in different parts of the emacs buffer any time I change a function name in

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Shantanu Kumar
One of the main issues I have faced with :use is, understanding a non-trivial codebase becomes very difficult and almost always requires Emacs Meta-dot. I'd vote for deprecating :use. Shantanu -- -- You received this message because you are subscribed to the Google Groups Clojure group. To

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Lee Spector
On Jul 23, 2013, at 3:06 PM, Gary Trakhman wrote: Yea, I have a single namespace with project-specific common utilities which I refer to as u/some-util-function. For me, it's a bit scary to have implicit symbols in scope. A typo can make a local binding refer to something that might not

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Cedric Greevey
On Tue, Jul 23, 2013 at 3:26 PM, Gary Trakhman gary.trakh...@gmail.comwrote: What's problematic about it is that it's slightly easier to do the wrong thing. It seems insignificant, but 98% of times you use use, it's going to be wrong. Also, 'use only' means I have to change my calling NS

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Sean Corfield
On Tue, Jul 23, 2013 at 12:57 PM, Lee Spector lspec...@hampshire.edu wrote: I'm sure I'm coming from a minority perspective on this, but for the kind of work I do it's often more important to be able to quickly sketch out and test ideas, without any ceremony about which functions come from

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Softaddicts
None of what has been said so far makes me believe that our usage of use is bad. It's like a rope, you can use it for useful purposes or you can hang yourself. You use it at your own taste and will. Lack of discipline does not constitute for me a reason to trash a feature as scarce as his

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Gary Trakhman
I think what we're proposing is not about removing the capability to do 'use'. That will remain, it's clojure after all. You could also implement it yourself easily enough. The issue is whether it's worthwhile to have it as a core function, without some kind of notice that better things exist.

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Stefan Kamphausen
On Tuesday, July 23, 2013 9:42:39 PM UTC+2, Shantanu Kumar wrote: One of the main issues I have faced with :use is, understanding a non-trivial codebase becomes very difficult and almost always requires Emacs Meta-dot. which is particularly annoying when you read code on a blog (as

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Ben Wolfson
On Tue, Jul 23, 2013 at 1:50 PM, Stefan Kamphausen ska2...@gmail.comwrote: It complects require and refer ;-) How so? -- Ben Wolfson Human kind has used its intelligence to vary the flavour of drinks, which may be sweet, aromatic, fermented or spirit-based. ... Family and social life also

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Sean Corfield
On Tue, Jul 23, 2013 at 1:53 PM, Ben Wolfson wolf...@gmail.com wrote: On Tue, Jul 23, 2013 at 1:50 PM, Stefan Kamphausen ska2...@gmail.com wrote: It complects require and refer ;-) How so? Because use = require + refer (essentially). -- Sean A Corfield -- (904) 302-SEAN An Architect's View --

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Lee Spector
On Jul 23, 2013, at 4:43 PM, Gary Trakhman wrote: For instance, we have defrecords now, no one's going to reach for defstruct because records are documented and promoted more thoroughly. FWIW I'm even a contrarian on defstruct :-! although I've switched to records anyway on account of

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Laurent PETIT
It's not as if *some* (cough cough) parts of Clojure were'nt opinionated, right? :-) Having in the (ns) macro the possibility to use :use, to use :require, to use :refer-clojure, to use :require-macros can be daunting, and not only for newcomers! And not to mention that the vast majority of the

Re: anaphoric macro?

2013-07-23 Thread eliassonaand
Thanks a lot guys, I'll try it out tomorrow. Anders -- -- 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

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Ben Wolfson
On Tue, Jul 23, 2013 at 1:55 PM, Sean Corfield seancorfi...@gmail.comwrote: On Tue, Jul 23, 2013 at 1:53 PM, Ben Wolfson wolf...@gmail.com wrote: On Tue, Jul 23, 2013 at 1:50 PM, Stefan Kamphausen ska2...@gmail.com wrote: It complects require and refer ;-) How so? Because use = require

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Softaddicts
Maybe we need an simpler alternative to the ns macro without all these complex options :) With a short name like ns-stop-banging-your-head-on-the-wall :) Or the reverse, ns-make-your-life-more-chaotic... :) Luc P. It's not as if *some* (cough cough) parts of Clojure were'nt opinionated,

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Laurent PETIT
2013/7/23 Softaddicts lprefonta...@softaddicts.ca: Maybe we need an simpler alternative to the ns macro without all these complex options :) With a short name like ns-stop-banging-your-head-on-the-wall :) would violate the rule use often = short name ;-) Or the reverse,

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Stefan Kamphausen
On Tuesday, July 23, 2013 11:13:11 PM UTC+2, Ben wrote: On Tue, Jul 23, 2013 at 1:55 PM, Sean Corfield seanco...@gmail.comjavascript: wrote: On Tue, Jul 23, 2013 at 1:53 PM, Ben Wolfson wol...@gmail.comjavascript: wrote: On Tue, Jul 23, 2013 at 1:50 PM, Stefan Kamphausen

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Sean Corfield
On Tue, Jul 23, 2013 at 2:13 PM, Ben Wolfson wolf...@gmail.com wrote: If that's all that's required for one thing to complect two others, clojure's rife with the stuff. if-let complects if and let. Destructuring assignment complects assignment and getting values from a data structure (as the

Re: Can't get namespace metadata

2013-07-23 Thread Colin Fleming
As an aside from this, how problematic is AOT compilation? It seems to be the source of many bugs (for example, my own CLJ-1227http://dev.clojure.org/jira/browse/CLJ-1227). Is there a list anywhere of things to watch out for when AOT compiling? On 24 July 2013 04:06, Stuart Sierra

Re: cannot import namespace reducers

2013-07-23 Thread Keith Maynard
Please spam the list!!! I am sure anyone who receives that message is probably running Mac OS X 10.7.x or later and trying to unravel the mess between Java 6 and Java 7. Please post recommendations. I finally got Eclipse to see the jdl1.7.0_25.jdk now how do I get the OS to replace the Apple

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread John Gabriele
On Tuesday, July 23, 2013 11:50:50 AM UTC-4, Greg Slepak wrote: I think I read somewhere that :use is no longer encouraged, but I could be mistaken. From what I've read, it seems like most people agree that Clojure has too many ways of including/importing/referencing/requiring/using

[ANN] verily, non-magic testing lib

2013-07-23 Thread Steven Degutis
https://github.com/evanescence/verily Verily is a new testing lib with a few goals: - Build off existing Clojure concepts (functions, vars, etc) - Be as functional/immutable as possible - Be easy to use from terminal or REPL - Have composable pieces that are easy to swap out -

Confused again by core.async

2013-07-23 Thread Alan Shaw
Hi, I hope I can get a lightbulb on what's happening here: https://github.com/nodename/async-plgd/blob/master/src/hoare/problem.clj Testing fan-in on a pair of processes and getting nutty results. Thanks, -A -- -- You received this message because you are subscribed to the Google Groups

Re: [ANN] verily, non-magic testing lib

2013-07-23 Thread Steven Degutis
Whoops. Looks like I didn't check the namespace well enough, there's already a lib called verily. (Sorry Justin.) Will think up a new name soon. On Tue, Jul 23, 2013 at 11:55 PM, Steven Degutis sbdegu...@gmail.comwrote: https://github.com/evanescence/verily Verily is a new testing lib with