Re: Avout: Distributed State in Clojure

2011-11-30 Thread AndyK
If you're willing to dig into another language, 'Erlang and OTP in Action' gives a great overview of Erlang and the distributed principles underlying that language. Though different from the approach of distributed STM, the concepts of distributed applications are baked into the core of Erlang.

ns/use/require/import inconsistent an confusing

2011-11-30 Thread Terje Dahl
Consider the following: (ns my.namespace.here) (use 'my.namespace.here :reload) (require '[my.namespace.here :as something]) (import [my.package MyClass1 MyClass2]) 1. Why (at least!) 4 different ways of noting namspaces/domains: With or without the escape-mark (') and with or

Re: Avout: Distributed State in Clojure

2011-11-30 Thread Linus Ericsson
In Clojure in Action (still in MEAP i think) there's a chapter about using (Erlang/OTP-based) RabbitMQ message queue server for making Clojure scalable in a Hadoopish map-reduce-way. Avout seems to solve many of the problems that easily could occur in such an approach by not needing a centralized

Re: ns/use/require/import inconsistent an confusing

2011-11-30 Thread j1n3l0
Also in a REPL you can do the following: user (use 'example.core) nil user But in a source file you have to do: (ns stuff.core (:use 'example.core)) I think I've seen the reason for this difference once before but can someone more learned *please* explain :) Thanks Nelo Ps: this exact

Re: When are you going to upload Conj2011 videos?

2011-11-30 Thread Doug South
On Wed, Nov 30, 2011 at 12:24 AM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: Byrd, Friedman, Byrd, Friedman, Byrd, Friedman :) Was their presentation actually recorded? I don't recall confreaks being there, but then again, I was too busy watching an excellent presentation...

Re: When are you going to upload Conj2011 videos?

2011-11-30 Thread Ambrose Bonnaire-Sergeant
Yes! On Wed, Nov 30, 2011 at 8:12 PM, Doug South doug.so...@gmail.com wrote: On Wed, Nov 30, 2011 at 12:24 AM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: Byrd, Friedman, Byrd, Friedman, Byrd, Friedman :) Was their presentation actually recorded? I don't recall confreaks

Re: [ANN] Drift DB

2011-11-30 Thread Luc Prefontaine
Ahem, considering that I regularly alternate between MySql, Postgres and Oracle databases, I like the idea of just calling a pop menu like Create table (full) and let Aqua spit out the DDL in an adjacent window while having a database explorer pane on the left :) Memory becomes a pricey real

Re: ns/use/require/import inconsistent an confusing

2011-11-30 Thread jongwon.choi
Even though I've written only one toy web framework in Clojure[1], (I think) I know the difference. Because there is documentation for use and ns, I'll add my own only :) I interpret (use 'ns) as Use 'ns namespace within *current* namespace - from your example, 'user'. Usually for REPL. (ns

Re: ns/use/require/import inconsistent an confusing

2011-11-30 Thread Stuart Sierra
This has been heavily discussed, and some work is underway to mitigate it. See http://dev.clojure.org/display/design/Loading%2C+Compiling%2C+and+Namespaces -S -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Drift DB

2011-11-30 Thread Matt
This should now be fixed in version 1.0.6. -Matt On Nov 29, 12:03 am, Luc Prefontaine lprefonta...@softaddicts.ca wrote: Hi Matt, working with this stuff... pretty sure I can make rake obsolete pretty soon :) However I am struggling with the auto increment column attribute...

Re: Drift DB

2011-11-30 Thread Luc Prefontaine
Thank you, Luc On Wed, 30 Nov 2011 07:18:56 -0800 (PST) Matt macourt...@gmail.com wrote: This should now be fixed in version 1.0.6. -Matt On Nov 29, 12:03 am, Luc Prefontaine lprefonta...@softaddicts.ca wrote: Hi Matt, working with this stuff... pretty sure I can make rake

Re: Baltimore Functional Programming

2011-11-30 Thread Gary Trakhman
Awesome, so it looks like there will be enough people to make this happen. I've been in touch with beehive about using their space. I'm considering whether or not to use meetup.com to organize everything, but I think for now I'll put together a simple wordpress/google-groups thing and

Re: Baltimore Functional Programming

2011-11-30 Thread rzeze...@gmail.com
I'm also interested. I just started to go to beehive occasionally and I was recently discussing with someone how it would be nice to have a FP group. I live in Federal Hill. On Nov 30, 11:09 am, Gary Trakhman gary.trakh...@gmail.com wrote: Awesome, so it looks like there will be enough people

Re: Drift 1.4.0 released.

2011-11-30 Thread Phil Hagelberg
On Tue, Nov 29, 2011 at 6:13 PM, Matt macourt...@gmail.com wrote: 1.4.2 is out now and should work with both Clojure 1.2.1 and 1.3.0. However, Leiningen currently doesn't work with Clojure 1.3.0. At work, I actually have a project.clj with Clojure 1.3.0 in the dependencies, and a Clojure

Re: Avout: Distributed State in Clojure

2011-11-30 Thread Sean Corfield
On Wed, Nov 30, 2011 at 2:39 AM, Linus Ericsson oscarlinuserics...@gmail.com wrote: In Clojure in Action (still in MEAP i think) there's a chapter about CiA was officially released at the Conj. Everyone who bought the MEAP should have had a notification by now about downloading the final version

Symbol matching in core.match

2011-11-30 Thread Alex Miller
I've been working with core.match some this week and finding it pretty nice. However, I have a common case (for me) that is not well handled right now via core.match: matching symbols. Say that I wrote a match like this: ;; translate (+ x (+ y z)) to (+ x y z) (let [e '(+ 1 (+ 2 3))] (match

Re: Symbol matching in core.match

2011-11-30 Thread David Nolen
(quote foo) should be interpreted as a literal match. I thought this was addressed by a previous user submitted patch but it doesn't look like that's true. We currently use seqs as a marker of custom syntax, we dispatch either on the first or second element of the seq. For example this is how we

ANN: Tentacles 0.1.0: A Github v3 API library for Clojure

2011-11-30 Thread Anthony Grimes
I just released v0.1.0 of my new Github API library, tentacles. Tentacles is the successor of my old v2 API library, clj-github. I went ahead and rewrote the whole thing because clj-github was a bit of a mess and the v3 API is different enough from the v2 API to warrant a new library. Also,

Re: noob question about error with tail recursion

2011-11-30 Thread coco
now I'm in a similar trouble...I'm trying resolve the problem 31 from 4clojure ...It says: Write a function which packs consecutive duplicates into sub-lists. [image: test not run] (= (__ [1 1 2 1 1 1 3 3]) '((1 1) (2) (1 1 1) (3 3))) I know than I can use identity and others clojure functions

Can't get the debugger cdt run

2011-11-30 Thread svenali
Hello all, I try to get the cdt debugger running and fail. I've build the cdt with leiningen and have this jar file in my classpath. A simple (use 'cdt.break) work. But if I want to use com.georgesjahad.cdt I get the following error message: = (use 'com.georgesjahad.cdt) #FileNotFoundException

[ANN] cadr: `car', ..., `cddddr' in Clojure

2011-11-30 Thread Peter Danenberg
Try as I might, I can't purge these anachronisms; so here are `car' to `cr' in all their glory: http://clojars.org/cadr This implementation uses a Kleene-closure around the alphabet {a, d} to generate the names; and a macro to define them:

Re: How can we Laucnh REPL from java Swing application?

2011-11-30 Thread svenali
Hi, you could do it in a way counterclockwise does. You can implement a repl that listening at an arbitrary port like doing this: (ns de.svenali.education.inES.tools.repl (:require clojure.main) (:import (java.io InputStreamReader PrintWriter) (java.net ServerSocket Socket)

Lazy sequence question

2011-11-30 Thread Paweł Łoziński
Hi everybody, I'd like to create a lazy sequence which has first element x and all the rest from another lazy sequence. I couldn't find a suitable function in the docs. Can somebody give a hint? Best regards PŁ -- You received this message because you are subscribed to the Google Groups

[newbie] Rebinding a recursive function

2011-11-30 Thread Roman Perepelitsa
Hello, I'm trying to intercept each call to a recursive function in order to insert logging. It works on the first invocation but not on others. What am I missing? (defn fact [n] (if ( n 2) 1 (* n (fact (dec n) ; Given function f, returns another function that ; does the same as f

Re: noob question about error with tail recursion

2011-11-30 Thread Chris Perkins
(recur (rest lista) ...) here: ^^^ lista is always the same thing. You probably meant (recur (rest rst) ...). - Chris -- 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

Re: Symbol matching in core.match

2011-11-30 Thread Steve Miner
On Nov 30, 2011, at 3:04 PM, David Nolen wrote: (quote foo) should be interpreted as a literal match. I thought this was addressed by a previous user submitted patch but it doesn't look like that's true. I wrote a patch that treated quoted keywords as literals so that ':when could be used

Re: noob question about error with tail recursion

2011-11-30 Thread carlos mendez
yep..that is an error but (recur (rest rst) I think wouln't work...maybe something like (defn packing [lista] (loop [[fst snd :as all] listamem []tmp '(fst)] (print all is all \n\n) ;;something is wrong...all always is a empty list (if (seq? all) (if (= fst snd)

Re: noob question about error with tail recursion

2011-11-30 Thread coco
yep..that is an error but (recur (rest rst) I think wouln't work...maybe something like (defn packing [lista] (loop [[fst snd :as all] listamem []tmp '(fst)] (print all is all \n\n) ;;something is wrong...all always is a empty list (if (seq? all) (if (=

Re: Lazy sequence question

2011-11-30 Thread Kasper Galschiot Markus
Is conf what you're looking for? http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/cons ~Kasper On 11/30/11 2:27 PM, Paweł Łoziński wrote: Hi everybody, I'd like to create a lazy sequence which has first element x and all the rest from another lazy sequence. I couldn't

Re: [core.logic] Incorporating a database as a source of facts

2011-11-30 Thread Sam Ritchie
Have you guys taken a look at Cascalog? ( https://github.com/nathanmarz/cascalog) It's a datalog implementation in Clojure that compiles down to MapReduce jobs. Cascalog's host, Cascading, allows you to pull information from a wide range of datasources (mySQL, HDFS, ElasticSearch, etc) and might

Re: Symbol matching in core.match

2011-11-30 Thread David Nolen
On Wed, Nov 30, 2011 at 4:29 PM, Steve Miner stevemi...@gmail.com wrote: On Nov 30, 2011, at 3:04 PM, David Nolen wrote: (quote foo) should be interpreted as a literal match. I thought this was addressed by a previous user submitted patch but it doesn't look like that's true. I wrote a

Re: [core.logic] Incorporating a database as a source of facts

2011-11-30 Thread David Nolen
On Wed, Nov 30, 2011 at 4:38 PM, Sam Ritchie sritchi...@gmail.com wrote: Have you guys taken a look at Cascalog? ( https://github.com/nathanmarz/cascalog) It's a datalog implementation in Clojure that compiles down to MapReduce jobs. Cascalog's host, Cascading, allows you to pull information

Re: Symbol matching in core.match

2011-11-30 Thread Alex Miller
Thanks all... I'm not actually complaining that symbols are taken for bind variables. I think in most common match uses that's very natural. Your suggested change wouldn't actually help me - this was just a dummy example; in the actual case for me the symbol starts with an alpha. If I *were*

Re: Symbol matching in core.match

2011-11-30 Thread David Nolen
On Wed, Nov 30, 2011 at 5:06 PM, Alex Miller a...@puredanger.com wrote: ;; plus is a symbol to match, _x, _y are variables (let [e '(plus 2 3)] (match [e] [([plus _x _y] :seq)] (+ _x _y))) To me, that gives them a placeholder feel and plays well with the use of _. This would break

Re: Symbol matching in core.match

2011-11-30 Thread Steve Miner
I filed the bug and attached a patch. The check for duplicate wildcards now ignores anything that's quoted. I'm in a rush so it might be good for others to try it out. http://dev.clojure.org/jira/browse/MATCH-42 Steve Miner stevemi...@gmail.com -- You received this message because you are

Re: noob question about error with tail recursion

2011-11-30 Thread Alan Malloy
(seq? ()) is true. You want (seq all), not (seq? all). There may be other problems, but that one jumps out at me. On Nov 30, 1:53 pm, coco clasesparticulares...@gmail.com wrote: yep..that is an error but (recur (rest rst) I think wouln't work...maybe something like (defn packing [lista]  

The Clojure way to solve this problem?

2011-11-30 Thread AndyK
I have Clojure code which makes HTTP requests to a server. Depending on the context, I want to swap out the underlying HTTP library code. For example, I use an instrumented library in a testing context and a different library in a REPL context where the instrumented library will not work. These

Re: Symbol matching in core.match

2011-11-30 Thread Alex Miller
That's ok by me. On Nov 30, 4:16 pm, David Nolen dnolen.li...@gmail.com wrote: So you want to use match for matching forms without having to quote everything? (let [e '(plus 2 3)]   (match e     ['plus x y] (+ x y))) To me the above would be ideal. Then it would be trivial for you to

Re: Symbol matching in core.match

2011-11-30 Thread Alex Miller
Ha, I wrote the identical patch locally and it seemed good to me. So it gets my ok! On Nov 30, 5:00 pm, Steve Miner stevemi...@gmail.com wrote: I filed the bug and attached a patch.  The check for duplicate wildcards now ignores anything that's quoted.  I'm in a rush so it might be good for

Re: Symbol matching in core.match

2011-11-30 Thread David Nolen
Looks good patch applied. On Wed, Nov 30, 2011 at 7:24 PM, Alex Miller a...@puredanger.com wrote: Ha, I wrote the identical patch locally and it seemed good to me. So it gets my ok! On Nov 30, 5:00 pm, Steve Miner stevemi...@gmail.com wrote: I filed the bug and attached a patch. The

Re: The Clojure way to solve this problem?

2011-11-30 Thread gaz jones
what about just re-defing the function inside the tests to the instrumented version? something like: (ns one.http) (defn get [] ...) (ns one.http-instrumented) (defn get [] ...) (ns one.test.blah) (with-redefs [one.http/get one.http-instrumented/get] ...) guess you could put the redefs into

Re: The Clojure way to solve this problem?

2011-11-30 Thread mmwaikar
I think you should look at the binding function - http://clojuredocs.org/clojure_core/clojure.core/binding In my tests, I am using this to run the same tests using two different functions, which are supposed to do the same thing (using two different methods, internally). In your case though,

Re: The Clojure way to solve this problem?

2011-11-30 Thread Baishampayan Ghose
I think you should look at the binding function - http://clojuredocs.org/clojure_core/clojure.core/binding In my tests, I am using this to run the same tests using two different functions, which are supposed to do the same thing (using two different methods, internally). In your case

Re: [ANN] cadr: `car', ..., `cddddr' in Clojure

2011-11-30 Thread Tassilo Horn
Peter Danenberg pe...@factual.com writes: Hi Peter, Try as I might, I can't purge these anachronisms; so here are `car' to `cr' in all their glory: http://clojars.org/cadr Nice. :-) This implementation uses a Kleene-closure around the alphabet {a, d} to generate the names; and a