function calling itself using a generic self reference call?

2012-08-06 Thread Dave Sann
(this is not a question about recur) Suppose I have: (defn v1 ([x] (v1 x [])) ([x r] (conj r x))) and I decide to make v2 - for whatever reason - say I think I have a better implementation for part of it so I start with a copy and edit: (defn v2 ([x] (v1 x [])) ([x r] (conj r

Re: function calling itself using a generic self reference call?

2012-08-06 Thread Carlo Zancanaro
1. would it be, or is it possible to have something generic like this? You could use: (def v1 (fn self ([x] (self x [])) ([x r] (conj r x))) 2. What about anonymous fns? The same idea, just without the def. (fn call-self ([x] (call-self x 0)) ([x y] ...))) -- You received this

Re: function calling itself using a generic self reference call?

2012-08-06 Thread Baishampayan Ghose
You might want to look at the Y Combinator for this. Regards, BG On Mon, Aug 6, 2012 at 11:36 AM, Dave Sann daves...@gmail.com wrote: (this is not a question about recur) Suppose I have: (defn v1 ([x] (v1 x [])) ([x r] (conj r x))) and I decide to make v2 - for whatever reason -

Re: function calling itself using a generic self reference call?

2012-08-06 Thread Dave Sann
I didn't know you could name functions made with fn like that. nice. It would be a handy feature for defn to have maybe... On Monday, 6 August 2012 16:16:06 UTC+10, Carlo wrote: 1. would it be, or is it possible to have something generic like this? You could use: (def v1 (fn self

Re: function calling itself using a generic self reference call?

2012-08-06 Thread Dave Sann
It would also be a useful ability in multimethods... On Monday, 6 August 2012 16:33:15 UTC+10, Dave Sann wrote: I didn't know you could name functions made with fn like that. nice. It would be a handy feature for defn to have maybe... On Monday, 6 August 2012 16:16:06 UTC+10, Carlo wrote:

Re: Strange coercions...

2012-08-06 Thread Laurent PETIT
Hello, Some single element project values (String) have been enhanced to muli-element values (vector of Strings). Check all your *-paths keys : :source-paths :resource-paths :test-paths Etc. HTH, Laurent Le 5 août 2012 à 03:42, Pierre-Henry Perret phper...@gmail.com a écrit : Running a

Re: Strange coercions...

2012-08-06 Thread Pierre-Henry Perret
Thanks, The problems is solved (see other thread on same subject) Le lundi 6 août 2012 09:18:18 UTC+2, lpetit a écrit : Hello, Some single element project values (String) have been enhanced to muli-element values (vector of Strings). Check all your *-paths keys : :source-paths

Re: Strange coercions

2012-08-06 Thread Pierre-Henry Perret
Problem solved, Thanks all Le dimanche 5 août 2012 10:32:14 UTC+2, Pierre-Henry Perret a écrit : Sean, It works now.. ! I have at last precated th lein1 project. You'll see in the code a *file:// *url that is particular to my current checkout version, by default *development *. Any

Re: Question about sets

2012-08-06 Thread Peter Taoussanis
Just throwing in my vote here (assuming anyone's keeping count): I agree with Mark that the current behavior is surprising and disagreeable. And while there's clearly a practical argument to be made from both perspectives, my own feeling is that throwing a hard runtime exception here is

Re: Clojure contrib profiler error

2012-08-06 Thread Peter Taoussanis
I cannibalized most of the old contrib profiling stuff for Timbre, btw: https://github.com/ptaoussanis/timbre#profiling - Peter Taoussanis (@ptaoussanis) -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: function calling itself using a generic self reference call?

2012-08-06 Thread nicolas.o...@gmail.com
(defn recurse [f] (fn [ args] (apply f (recurse f) args))) (def fac (recurse (fn [self n] (if (zero? n) 1 (* n (self (dec n))) There is a performance cost. recursive can be specialised on different number of arguments, to reduce this cost.

Re: record constructor

2012-08-06 Thread nicolas.o...@gmail.com
My answer to this is: everything is an implementation at some level. So do you think we need factory functions of factory functions, and factory functions of factory functions of factory functions? I am sure that will be more flexible than just one level of factory functions. We already have

Re: Question about sets

2012-08-06 Thread Laurent PETIT
Fwiw, inc on what Marc said Le 6 août 2012 à 10:39, Peter Taoussanis ptaoussa...@gmail.com a écrit : Just throwing in my vote here (assuming anyone's keeping count): I agree with Mark that the current behavior is surprising and disagreeable. And while there's clearly a practical argument to

Re: record constructor

2012-08-06 Thread Softaddicts
Adding complexity to a language on the basis that it fits your perception on what is easier to read while there is already another alternative covering several other use cases is the central issue here. My reluctance (or allergy as you may suggest) about OOP is toward the popular

Re: Overtone - Live @ Arnolfini

2012-08-06 Thread Granville Barnett
That's amazing ;-) Granville On 5 August 2012 19:11, Sam Aaron samaa...@gmail.com wrote: On 4 Aug 2012, at 17:23, Tom Maynard tom.w...@gmail.com wrote: Bravo! Standing ovation. Technical difficulties be d*mned, that was a spectacular exhibition. I was reminded of a live premiere

ClojureScript protocols

2012-08-06 Thread Alexander Solovyov
Hi all, I'm trying to get simple ClojureScript application to work. I have a simple protocol Map here: https://github.com/piranha/cj-locations/blob/master/src/map.cljs And an implementation of it here (I tried with extend-type as well):

serlization of map ---- Invalid token: :

2012-08-06 Thread 4m1r
I am using Storm which is based on Clojure. while emitting a map which has keywords as keys we get the following exception. When we have strings as keys we dont get this exception. Sounds like serialization problem. I have also checked the source of LispReader it should have : as a valid token.

Re: Clojure contrib profiler error

2012-08-06 Thread Adrian Mowat
@odyssomay, @Luc thanks very much. That explains the problems I was having @Peter, timbre looks very interesting. Thanks for posting it On Monday, 6 August 2012 10:08:19 UTC+1, Peter Taoussanis wrote: I cannibalized most of the old contrib profiling stuff for Timbre, btw:

Re: The 2012 'State of Clojure' survey is open

2012-08-06 Thread Chas Emerick
FYI, the results from the 2012 State of Clojure survey are now available (with a kitten…seriously!): http://cemerick.com/2012/08/06/results-of-the-2012-state-of-clojure-survey/ Thanks to everyone that participated, - Chas On Jul 25, 7:39 pm, Chas Emerick c...@cemerick.com wrote: Just a

Re: Playing with clojure-encog, Machine-Learning wrapper

2012-08-06 Thread Jim - FooBar();
I'm surprised you didn't post your question on the Financial Neural Networks section of the forum but on the Using encog in Java instead! You did see it right? Just trying to help here... :-) . I'm genuinely interested in your problem and I'd love to see the solution unfold! In fact if you

Re: serlization of map ---- Invalid token: :

2012-08-06 Thread Alan Malloy
You are attempting to serialize the empty keyword. The empty string, , is fine to store, but : is not. You will get the same error from (read-string :). On Monday, August 6, 2012 4:55:23 AM UTC-7, 4m1r wrote: I am using Storm which is based on Clojure. while emitting a map which has

ANN lein-expectations 0.0.7

2012-08-06 Thread Sean Corfield
lein-expectations - the plugin for running Jay Fields' awesome Expectations testing library - has been updated for Leiningen 2.0. If you are using Leiningen 1.x, continue to use lein-expectations 0.0.5. If you are on Leiningen 2.x, you should use lein-expectations 0.0.7 so that exit on test

Re: ANN lein-expectations 0.0.7

2012-08-06 Thread Laurent PETIT
Links ? Le 6 août 2012 à 20:43, Sean Corfield seancorfi...@gmail.com a écrit : lein-expectations - the plugin for running Jay Fields' awesome Expectations testing library - has been updated for Leiningen 2.0. If you are using Leiningen 1.x, continue to use lein-expectations 0.0.5. If you

Re: ANN lein-expectations 0.0.7

2012-08-06 Thread Sean Corfield
On Mon, Aug 6, 2012 at 12:01 PM, Laurent PETIT laurent.pe...@gmail.com wrote: Links ? https://clojars.org/lein-expectations https://github.com/gar3thjon3s/lein-expectations Le 6 août 2012 à 20:43, Sean Corfield seancorfi...@gmail.com a écrit : lein-expectations - the plugin for running Jay

Re: record constructor

2012-08-06 Thread Warren Lynn
We already have them. They are just functions. (And I think thinking in term of factory functions does not make sense. Every pure function takes something and makes something out of it) The construction of data from data is best taken care by functions. That way you don't expose more

ANN Spyglass 1.0

2012-08-06 Thread Michael Klishin
Spyglass (http://clojurememcached.info) is a small and very fast Clojure client for Memcached that can also be used with Couchbase Server and Kestrel. Spyglass is built on top of SpyMemcached, a mature battled tested Memcached client. What can you do with Spyglass? * Perform sync and async

Re: record constructor

2012-08-06 Thread Craig Brozefsky
Warren Lynn wrn.l...@gmail.com writes: If you say constructor is bad because it is not flexible, where bad means we should not do it at all, then what makes you think one-level factory function good? Isn't two-level factory function even more flexible? Then isn't three-level

why would this fail in core.logic?

2012-08-06 Thread Jim - FooBar();
caution! logic noob question following...why does the following fail? can anyone help with this? the stack trace is not very helpful! (defn bishop-moves [x y] (let [xmax 8 ymax 8] (run* [q] (fresh [a b] ( a xmax) ( b ymax) (= (Math/abs (- x a))

Re: ANN lein-expectations 0.0.7

2012-08-06 Thread Laurent PETIT
Thanks, sorry for the short email, it was sent from smartphone 2012/8/6 Sean Corfield seancorfi...@gmail.com On Mon, Aug 6, 2012 at 12:01 PM, Laurent PETIT laurent.pe...@gmail.com wrote: Links ? https://clojars.org/lein-expectations https://github.com/gar3thjon3s/lein-expectations Le

Re: ANN lein-expectations 0.0.7

2012-08-06 Thread Laurent PETIT
Wow Expectations wasn't in my radar, thanks for helping me fix this, since it looks like a really useful and featureful test library. I love the way it clearly has a path to JUnit integration which should really help leverage existing IDEs possibilities in this area. Makes me think again on

Re: Playing with clojure-encog, Machine-Learning wrapper

2012-08-06 Thread Timothy Washington
Hey Jim, Yes, that was actually the first place I was going to post the question. But what I noticed, was that the Financial Neural Networkhttp://www.heatonresearch.com/neural-network-forums/financial-neural-networks section, was geared more towards users of financial software, rather than

Re: The 2012 'State of Clojure' survey is open

2012-08-06 Thread Phil Hagelberg
On Mon, Aug 6, 2012 at 7:21 AM, Chas Emerick c...@cemerick.com wrote: FYI, the results from the 2012 State of Clojure survey are now available (with a kitten…seriously!): http://cemerick.com/2012/08/06/results-of-the-2012-state-of-clojure-survey/ Thanks for taking the time to do this. There's

Re: why would this fail in core.logic?

2012-08-06 Thread cej38
I am a core.logic noob as well, but I think David Nolen talked about this in a presentation that you can watch at: http://vimeo.com/46163091 He will start talking about what I think you are interested in at about 12 minutes and 20 seconds into the presentation. By the way, if I grow my hair

Re: ANN lein-expectations 0.0.7

2012-08-06 Thread John Gabriele
On Monday, August 6, 2012 3:06:47 PM UTC-4, Sean Corfield wrote: On Mon, Aug 6, 2012 at 12:01 PM, Laurent PETIT wrote: Links ? https://clojars.org/lein-expectations https://github.com/gar3thjon3s/lein-expectations Maybe list this at

Re: ANN lein-expectations 0.0.7

2012-08-06 Thread Sean Corfield
On Mon, Aug 6, 2012 at 6:01 PM, John Gabriele jmg3...@gmail.com wrote: Maybe list this at https://github.com/technomancy/leiningen/wiki/Plugins ? Done. I didn't know it wasn't already there! -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. --

Re: [ANN] Clojars deployment over https

2012-08-06 Thread Mikera
Great stuff! I'm trying to use this functionality to deploy a library using Maven/Eclipse Juno on Windows and keep getting a timeout (but interestingly the jar and pom do make it up there) - see this SO question :

Re: record constructor

2012-08-06 Thread Warren Lynn
My reluctance (or allergy as you may suggest) about OOP is toward the popular implementations that are insanely verbose. Why is it insanely verbose? Just look at my example: (defrecord MyRecord [x y z] (make-record [arg1 arg2 arg3 ...] ...)) (make-record MyRecord arg1 arg2 arg3 ...)

Re: Strange coercions

2012-08-06 Thread Pierre-Henry Perret
Have you diagnose any malformations ? I'm somewwhat expectative with *lein / 2 *paradigm Notably that response to * lein2 repl * *Exception in thread main java.io.FileNotFoundException: -m* *lein repl Warning: problem requiring leiningen.cljsbuild hook: Could not locate

Re: why would this fail in core.logic?

2012-08-06 Thread David Nolen
You have to be careful when using Clojure or Java operations in core.logic programs. I would recommend avoiding it until you're comfortable with writing pure core.logic programs. On Monday, August 6, 2012, Jim - FooBar(); wrote: caution! logic noob question following...why does the following

School Seating Charts

2012-08-06 Thread Evan Mezeske
I just launched https://www.schoolseatingcharts.com , which might be of interest to this mailing list because it's constructed out of 100% Clojure and ClojureScript. The codebase is about 60% Clojure (all running on the server) and 40% ClojureScript (all running on the client). Altogether, it

Re: [ANN] Clojars deployment over https

2012-08-06 Thread Nelson Morris
On Mon, Aug 6, 2012 at 8:52 PM, Mikera mike.r.anderson...@gmail.com wrote: Great stuff! I'm trying to use this functionality to deploy a library using Maven/Eclipse Juno on Windows and keep getting a timeout (but interestingly the jar and pom do make it up there) - see this SO question :

Re: why would this fail in core.logic?

2012-08-06 Thread Baishampayan Ghose
On Tue, Aug 7, 2012 at 6:21 AM, cej38 junkerme...@gmail.com wrote: By the way, if I grow my hair out will I become as technically awesome as David and Rich? YMMV :) Regards, BG -- Baishampayan Ghose b.ghose at gmail.com -- You received this message because you are subscribed to the Google