Re: [ANN] Leiningen 2.0.0-preview9 released

2012-08-25 Thread Christian Sperandio
Hi,

I did a lein upgrade and now when I launch lein, I've got this error:

chrix@Batman:~$ lein help
Check :dependencies and :repositories for typos.
It's possible the specified jar is not in any repository.
If so, see Free-floating Jars under http://j.mp/repeatability
Could not resolve dependencies


Chris

Le samedi 25 août 2012 02:34:51 UTC+2, Phil Hagelberg a écrit :


 I'm happy to announce the release of Leiningen version 2.0.0-preview9. 

 This release fixes a serious bug where profiles wouldn't be applied 
 correctly in the trampoline task as well making auto-loaded hooks and 
 middleware more consistent. It also introduces an experimental new flag 
 ($LEIN_FAST_TRAMPOLINE) allowing trampoline calls to cache their command 
 so that repeated invocations can happen without launching Leiningen's JVM. 

 ## 2.0.0-preview9 / 2012-08-24 

 * Use :provided profile by default everywhere except uberjar. (Marshall 
 Vandegrift) 
 * Unify format for auto-loading middleware and hooks. (Justin Balthrop) 
 * Allow more declarative :nrepl-middleware settings. (Chas Emerick) 
 * Fix :eval-in :classloader for native dependencies. (Justin Balthrop) 
 * Support project and user leinrc file for shell-level customization. 
 (Justin Balthrop) 
 * Cache trampoline commands for fast boot. Set $LEIN_FAST_TRAMPOLINE to 
 enable. 
 * Support setting HTTPS proxies. 
 * Improved resilience when self-install is interrupted. (Bruce Adams) 
 * Fix a bug where profile dependencies weren't honored in trampoline task. 

 As usual, `lein upgrade` will get you the latest version if you're 
 already running a 2.x preview. Otherwise you can fetch it from 
 https://raw.github.com/technomancy/leiningen/preview/bin/lein. 
 Especially if you use the trampoline task, you should be sure to 
 upgrade. 

 Hope you find this useful. Please report any problems via GitHub issues 
 or the mailing list. 

 Thanks, 
 Phil 


-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] Leiningen 2.0.0-preview9 released

2012-08-25 Thread Christian Sperandio
I found.

I went to a project folder and launching lein help, lein downloaded the 
necessary package. And now, it seems ok.
But it's weird I couldn't do a lein help in any folder.

Chris


Le samedi 25 août 2012 08:53:09 UTC+2, Christian Sperandio a écrit :

 Hi,

 I did a lein upgrade and now when I launch lein, I've got this error:

 chrix@Batman:~$ lein help
 Check :dependencies and :repositories for typos.
 It's possible the specified jar is not in any repository.
 If so, see Free-floating Jars under http://j.mp/repeatability
 Could not resolve dependencies


 Chris

 Le samedi 25 août 2012 02:34:51 UTC+2, Phil Hagelberg a écrit :


 I'm happy to announce the release of Leiningen version 2.0.0-preview9. 

 This release fixes a serious bug where profiles wouldn't be applied 
 correctly in the trampoline task as well making auto-loaded hooks and 
 middleware more consistent. It also introduces an experimental new flag 
 ($LEIN_FAST_TRAMPOLINE) allowing trampoline calls to cache their command 
 so that repeated invocations can happen without launching Leiningen's 
 JVM. 

 ## 2.0.0-preview9 / 2012-08-24 

 * Use :provided profile by default everywhere except uberjar. (Marshall 
 Vandegrift) 
 * Unify format for auto-loading middleware and hooks. (Justin Balthrop) 
 * Allow more declarative :nrepl-middleware settings. (Chas Emerick) 
 * Fix :eval-in :classloader for native dependencies. (Justin Balthrop) 
 * Support project and user leinrc file for shell-level customization. 
 (Justin Balthrop) 
 * Cache trampoline commands for fast boot. Set $LEIN_FAST_TRAMPOLINE to 
 enable. 
 * Support setting HTTPS proxies. 
 * Improved resilience when self-install is interrupted. (Bruce Adams) 
 * Fix a bug where profile dependencies weren't honored in trampoline 
 task. 

 As usual, `lein upgrade` will get you the latest version if you're 
 already running a 2.x preview. Otherwise you can fetch it from 
 https://raw.github.com/technomancy/leiningen/preview/bin/lein. 
 Especially if you use the trampoline task, you should be sure to 
 upgrade. 

 Hope you find this useful. Please report any problems via GitHub issues 
 or the mailing list. 

 Thanks, 
 Phil 



-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] Leiningen 2.0.0-preview9 released

2012-08-25 Thread Michael Klishin
2012/8/25 Christian Sperandio christian.speran...@gmail.com

 I found.

 I went to a project folder and launching lein help, lein downloaded the
 necessary package. And now, it seems ok.
 But it's weird I couldn't do a lein help in any folder.


 GH issue: https://github.com/technomancy/leiningen/issues/747

-- 
MK

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Can CLJS functions have metadata?

2012-08-25 Thread Shantanu Kumar
Hi,

I noticed that `with-meta` is not working on function objects in CLJS. 
Compilation fails with the following error:

Error: No protocol method IWithMeta.-with-meta defined for type function: 
function (maps, x) {
  return x;
}

I tried it out on the REPL and found the following:

-- BEGIN: repl-rhino --
ClojureScript:cljs.user (with-meta #(do :foo) {:foo :bar})
Error evaluating: (with-meta (fn* [] (do :foo)) {:foo :bar}) :as 
cljs.core.with_meta.call(null,(function (){\nreturn 
\\\uFDD0'foo\;\n}),cljs.core.ObjMap.fromObject([\\\uFDD0'foo\],{\\\uFDD0'foo\:\\\uFDD0'bar\}));\n
org.mozilla.javascript.JavaScriptException: Error: No protocol method 
IWithMeta.-with-meta defined for type function: 
function () {
return \ufdd0'foo;
}
 (cljs/core.cljs#222)
at cljs/core.cljs:222 (anonymous)
at cljs/core.cljs:214 (_with_meta)
at cljs/core.cljs:806 (with_meta)
at cljs repl:2 (anonymous)
at cljs repl:2

nil
-- END: repl-rhino --

Is this supposed to be a bug? I can file an issue on JIRA if so.

Shantanu

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: The Value of Values

2012-08-25 Thread Balint Erdi
I'd like to read that thread, can you provide a url?

Thank you,
Balint

On Saturday, August 25, 2012 2:41:40 AM UTC+2, Bost wrote:

 See the thread The Value of Values started by Conrad Barski 


-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: The Value of Values

2012-08-25 Thread Mayank Jain
Here you go :-
https://groups.google.com/d/topic/clojure/XMbo15-gk6M/discussion

On Sat, Aug 25, 2012 at 8:08 PM, Balint Erdi balint.e...@gmail.com wrote:

 I'd like to read that thread, can you provide a url?

 Thank you,
 Balint


 On Saturday, August 25, 2012 2:41:40 AM UTC+2, Bost wrote:

 See the thread The Value of Values started by Conrad Barski

  --
 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
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] Leiningen 2.0.0-preview9 released

2012-08-25 Thread Phil Hagelberg
Christian Sperandio christian.speran...@gmail.com writes:

 I went to a project folder and launching lein help, lein downloaded
 the necessary package. And now, it seems ok.
 But it's weird I couldn't do a lein help in any folder.

Yeah, just tracked down the cause of this bug. There is a workaround here:

https://github.com/technomancy/leiningen/issues/747#issuecomment-8024136

I hope to have another preview release fixing this in a day or two.

-Phil

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Rich's The Value of Values and REST

2012-08-25 Thread Softaddicts
A 12 billions market has been created just to address the need for bookkeeping
historic data, it's called business intelligence (BI).

Never heard of data warehouses and OLAP tools ? Many businesses use these
if they can pay for them

These things are cumbersome to implement, you have to extract data from your
operational systems following a tight schedule (otherwise data gets obliterated
before you can grab it) and import it in a BI backend and get it reorganized.

Data to be dumped in the BI backend has to be selected, frequency of uploads,
..  You cannot be certain that you grabbed everything that
matters, not knowing what future needs analysts may have. You also need a 
separate
infrastructure to run the whole gizmo.

Having a database where values can be read at will, replicated transparently
and scale easily where you do not loose any fact would simplify BI 
implementations a lot.
Most probably the whole migration process could be tossed away. The only
remaining need would be the creation of meta data needed for the analysis tool.

It may be important for us to forget past facts, otherwise we would go crazy but
may I point out that our brains never forget anything, we happen to have
neural cells specialized to hide past facts but these can be recalled.

As you age, this mechanism fails from time to time and can bring you back fresh 
souvenirs like if events happened yesterday.

 :

Luc P.

  I just enjoy the speeches better by standing back a little bit.
 
 Actually I'm quite annoyed that Rich doesn't say anything about how
 important is to be able to forget facts, irreversibly filter things
 out and reinvent the wheel again. Imagine a huge database full of
 facts you're simply not interested in. What is it good for?
 
 BTW there are stories about people not been able to forget. They
 remember every useless trivia, quarrel or conflict they ever
 experienced and they have to go over and over every good or bad memory
 just to recall things like Did I meet you before or after 2005?.
 Pretty much like our databases: select * from the
 5TB-useless-stuff.txt what happened between BIG-BANG and NOW
 
 Bost
 
 -- 
 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
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 
--
Softaddictslprefonta...@softaddicts.ca sent by ibisMail from my ipad!

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Can CLJS functions have metadata?

2012-08-25 Thread David Nolen
On Sat, Aug 25, 2012 at 3:49 AM, Shantanu Kumar
kumar.shant...@gmail.com wrote:
 Hi,

 I noticed that `with-meta` is not working on function objects in CLJS.
 Compilation fails with the following error:

 Error: No protocol method IWithMeta.-with-meta defined for type function:
 function (maps, x) {
   return x;
 }

It's not currently supported. Ticket welcome. If you have ideas about
a good approach that's even better. Part of the problem is that
Clojure fns are just JS fns.

David

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


problem 58 on 4clojure

2012-08-25 Thread John Holland
This problem is really confusing me. I found a solution online, but I
can't understand the solution. Can anyone explain to me why this
works?

The problem is stated as:



Write a function which allows you to create function compositions. The
parameter list should take a variable number of functions, and create
a function applies them from right-to-left.
(= [3 2 1] ((__ rest reverse) [1 2 3 4]))
(= 5 ((__ (partial + 3) second) [1 2 3 4]))


The examples would accept the solution replacing the .

The solution I found is:

(fn [x  xs]
  (fn [ args]
((fn step [[f  fs] a]
   (if fs
 (f (step fs a))
 (apply f a)))
 (cons x xs) args)))


This works, and baffles me when I try to understand it.

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: problem 58 on 4clojure

2012-08-25 Thread Bronsa
check out clojure.core/comp, and it's source

2012/8/25 John Holland jbholl...@gmail.com

 This problem is really confusing me. I found a solution online, but I
 can't understand the solution. Can anyone explain to me why this
 works?

 The problem is stated as:



 Write a function which allows you to create function compositions. The
 parameter list should take a variable number of functions, and create
 a function applies them from right-to-left.
 (= [3 2 1] ((__ rest reverse) [1 2 3 4]))
 (= 5 ((__ (partial + 3) second) [1 2 3 4]))


 The examples would accept the solution replacing the .

 The solution I found is:

 (fn [x  xs]
   (fn [ args]
 ((fn step [[f  fs] a]
(if fs
  (f (step fs a))
  (apply f a)))
  (cons x xs) args)))


 This works, and baffles me when I try to understand it.

 --
 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
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: problem 58 on 4clojure

2012-08-25 Thread Bronsa
its*

2012/8/25 Bronsa brobro...@gmail.com

 check out clojure.core/comp, and it's source


 2012/8/25 John Holland jbholl...@gmail.com

 This problem is really confusing me. I found a solution online, but I
 can't understand the solution. Can anyone explain to me why this
 works?

 The problem is stated as:



 Write a function which allows you to create function compositions. The
 parameter list should take a variable number of functions, and create
 a function applies them from right-to-left.
 (= [3 2 1] ((__ rest reverse) [1 2 3 4]))
 (= 5 ((__ (partial + 3) second) [1 2 3 4]))


 The examples would accept the solution replacing the .

 The solution I found is:

 (fn [x  xs]
   (fn [ args]
 ((fn step [[f  fs] a]
(if fs
  (f (step fs a))
  (apply f a)))
  (cons x xs) args)))


 This works, and baffles me when I try to understand it.

 --
 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
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: problem 58 on 4clojure

2012-08-25 Thread Erlis Vidal
How can I find the problem # 58?

This is something I was looking right now. What's the best order to follow?
I know I can sort by complexity but I think there should be a better way to
sort them.

Thanks

On Sat, Aug 25, 2012 at 1:05 PM, Bronsa brobro...@gmail.com wrote:

 its*


 2012/8/25 Bronsa brobro...@gmail.com

 check out clojure.core/comp, and it's source


 2012/8/25 John Holland jbholl...@gmail.com

 This problem is really confusing me. I found a solution online, but I
 can't understand the solution. Can anyone explain to me why this
 works?

 The problem is stated as:



 Write a function which allows you to create function compositions. The
 parameter list should take a variable number of functions, and create
 a function applies them from right-to-left.
 (= [3 2 1] ((__ rest reverse) [1 2 3 4]))
 (= 5 ((__ (partial + 3) second) [1 2 3 4]))


 The examples would accept the solution replacing the .

 The solution I found is:

 (fn [x  xs]
   (fn [ args]
 ((fn step [[f  fs] a]
(if fs
  (f (step fs a))
  (apply f a)))
  (cons x xs) args)))


 This works, and baffles me when I try to understand it.

 --
 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
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en



  --
 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
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: problem 58 on 4clojure

2012-08-25 Thread Mayank Jain
On Sat, Aug 25, 2012 at 10:54 PM, Erlis Vidal er...@erlisvidal.com wrote:

 How can I find the problem # 58?


http://www.4clojure.com/problem/58
Just modify the parameter to the problem number you want to see.


 This is something I was looking right now. What's the best order to
 follow?


Start with the first problem and continue in that order. I find that the
best way to do as lot of problems are build up on previous set of problems.
Cheers.

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: problem 58 on 4clojure

2012-08-25 Thread Erlis Vidal
Thanks for the link. I didnt notice the problem number in the URL. I've
sorted the problems and lost the default order.

Thanks again
Erlis

On Sat, Aug 25, 2012 at 1:29 PM, Mayank Jain firesof...@gmail.com wrote:

 On Sat, Aug 25, 2012 at 10:54 PM, Erlis Vidal er...@erlisvidal.comwrote:

 How can I find the problem # 58?


 http://www.4clojure.com/problem/58
 Just modify the parameter to the problem number you want to see.


 This is something I was looking right now. What's the best order to
 follow?


 Start with the first problem and continue in that order. I find that the
 best way to do as lot of problems are build up on previous set of problems.
 Cheers.

 --
 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
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: problem 58 on 4clojure

2012-08-25 Thread Denis Labaye
On Sat, Aug 25, 2012 at 6:47 PM, John Holland jbholl...@gmail.com wrote:

 This problem is really confusing me. I found a solution online, but I
 can't understand the solution. Can anyone explain to me why this
 works?

 The problem is stated as:



 Write a function which allows you to create function compositions. The
 parameter list should take a variable number of functions, and create
 a function applies them from right-to-left.
 (= [3 2 1] ((__ rest reverse) [1 2 3 4]))
 (= 5 ((__ (partial + 3) second) [1 2 3 4]))


 The examples would accept the solution replacing the .

 The solution I found is:

 (fn [x  xs]
   (fn [ args]
 ((fn step [[f  fs] a]
(if fs
  (f (step fs a))
  (apply f a)))
  (cons x xs) args)))


 This works, and baffles me when I try to understand it.


It's obfuscated by the fact that in 4clojure, the smaller is the code, the
higher is your score.

Divide  Conquer works fine here to understand what's going on:

https://gist.github.com/3468564 :


;; you are starting here

(fn [x  xs]
  (fn [ args]
((fn step [[f  fs] a]
   (if fs
 (f (step fs a))
 (apply f a)))
 (cons x xs) args)))

;; name the fn

(defn mycomp
  [x  xs] (fn [ args]
 ((fn step [[f  fs] a]
(if fs
  (f (step fs a))
  (apply f a)))
  (cons x xs) args)))

;; extract the step function

(defn step Equivalent to (apply (comp f  fs) args)
  [[f  fs] args] (if fs
(f (step fs args))
(apply f args)))

(defn mycomp Equivalent to (partial step fns)
  [ fns] (fn [ args]
(step fns args)))

;; rename a few things for clarity

(defn comp-then-apply Equivalent to (apply (comp f  fs) args)
  [[f  fs] args] (if fs
(f (comp-then-apply fs args))
(apply f args)))

(defn mycomp Equivalent to (partial comp-then-apply fns)
  [ fns] (fn [ args]
(comp-then-apply fns args)))


And use the REPL luke!

HTH

Denis



 --
 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
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] Leiningen 2.0.0-preview9 released

2012-08-25 Thread Sam Aaron
I'm having a problem upgrading due to SSL certificate issues

(I'm running OS X 10.8.1):


λ lein upgrade  
   
The script at /Users/sam/bin/lein will be upgraded to the latest preview 
version.  
Do you want to continue [Y/n]?  
   

   
Upgrading...
   
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current 
   
 Dload  Upload   Total   SpentLeft  Speed   
   
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 0  
   
curl: (60) SSL certificate problem, verify that the CA cert is OK. Details: 
   
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify 
failed  
More details here: http://curl.haxx.se/docs/sslcerts.html   
   

   
curl performs SSL certificate verification by default, using a bundle 
   
 of Certificate Authority (CA) public keys (CA certs). If the default   
   
 bundle file isn't adequate, you can specify an alternate file  
   
 using the --cacert option. 
   
If this HTTPS server uses a certificate signed by a CA represented in   
   
 the bundle, the certificate verification probably failed due to a  
   
 problem with the certificate (it might be expired, or the name might   
   
 not match the domain name in the URL). 
   
If you'd like to turn off curl's verification of the certificate, use   
   
 the -k (or --insecure) option.

Sam

---
http://sam.aaron.name

   


On 25 Aug 2012, at 01:34, Phil Hagelberg p...@hagelb.org wrote:

 
 I'm happy to announce the release of Leiningen version 2.0.0-preview9.
 
 This release fixes a serious bug where profiles wouldn't be applied
 correctly in the trampoline task as well making auto-loaded hooks and
 middleware more consistent. It also introduces an experimental new flag
 ($LEIN_FAST_TRAMPOLINE) allowing trampoline calls to cache their command
 so that repeated invocations can happen without launching Leiningen's JVM.
 
 ## 2.0.0-preview9 / 2012-08-24
 
 * Use :provided profile by default everywhere except uberjar. (Marshall 
 Vandegrift)
 * Unify format for auto-loading middleware and hooks. (Justin Balthrop)
 * Allow more declarative :nrepl-middleware settings. (Chas Emerick)
 * Fix :eval-in :classloader for native dependencies. (Justin Balthrop)
 * Support project and user leinrc file for shell-level customization. (Justin 
 Balthrop)
 * Cache trampoline commands for fast boot. Set $LEIN_FAST_TRAMPOLINE to 
 enable.
 * Support setting HTTPS proxies.
 * Improved resilience when self-install is interrupted. (Bruce Adams)
 * Fix a bug where profile dependencies weren't honored in trampoline task.
 
 As usual, `lein upgrade` will get you the latest version if you're
 already running a 2.x preview. Otherwise you can fetch it from
 https://raw.github.com/technomancy/leiningen/preview/bin/lein.
 Especially if you use the trampoline task, you should be sure to
 upgrade.
 
 Hope you find this useful. Please report any problems via GitHub issues
 or the mailing list.
 
 Thanks,
 Phil
 
 -- 
 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
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: problem 58 on 4clojure

2012-08-25 Thread nicolas.o...@gmail.com
Here's my take:

We want to define a function my-comp. It takes n functions and return
their composition.
We want to return a function of any number of arguments, so let's
start by working with a given
set of argument args, and returning the value of the composition
applied to those arguments.

- If I compose only one function, you get the value of the function itself:
  (value-my-comp f)  = (apply f args)

- By definition of composition:
 (value-my-comp f1 f2  fn)  = (f1 (value-my-comp f2  fn))
(Take all the arguments, apply it to the composition of function f2
 fn, and then apply the result to f1).

Then you remove the dots:

(value-my-comp f1  f2-fn) =  (f1  (apply value-my-comp f2-fn))

Then you can just put them all together:


(fn [ fs] ;; we take a bunch of functions in
 (fn [  args ]  ;; we take the arguments of the resulting function in.
   (letfn [(value-my-comp ;; the value of the result in term of the
functions is:
   ([f] (apply f args))   ;; only one function
   ([f1  f2-fn] (f1 (apply value-my-comp f2-fn]  ;;
more than one function
  (apply value-my-comp fs  ;; we compute the value of the
actual function we got.

If you don't like (apply value-my-comp f2-fn), you can make
value-my-comp actually takes a sequence
of functions:

(fn [ fs] ;; take the functions
 (fn [  args ]  ;; the arguments of the resulting functions
   (letfn [(value-my-comp
[[f1  f2-fn]]  ;; a list of functions
  (if (empty? f2-fn)  ;; only one function?
  (apply f1 args)  ;; then we apply the args to it
  (f1 (value-my-comp f2-fn] ;; else we compose
  (value-my-comp fs
This one is another way of writing the one you posted.
(Using a let instead of applying it directly, and not using a
non-varying argument a.)

If you want to see how this function can be written to be very
performant look at
comp source code, it is very interesting.

Best,

Nicolas.

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: problem 58 on 4clojure

2012-08-25 Thread John Holland
Thanks to a for the replies. I will study them later when I am free.
On Aug 25, 2012 2:37 PM, nicolas.o...@gmail.com nicolas.o...@gmail.com
wrote:

 Here's my take:

 We want to define a function my-comp. It takes n functions and return
 their composition.
 We want to return a function of any number of arguments, so let's
 start by working with a given
 set of argument args, and returning the value of the composition
 applied to those arguments.

 - If I compose only one function, you get the value of the function
itself:
   (value-my-comp f)  = (apply f args)

 - By definition of composition:
  (value-my-comp f1 f2  fn)  = (f1 (value-my-comp f2  fn))
 (Take all the arguments, apply it to the composition of function f2
  fn, and then apply the result to f1).

 Then you remove the dots:

 (value-my-comp f1  f2-fn) =  (f1  (apply value-my-comp f2-fn))

 Then you can just put them all together:


 (fn [ fs] ;; we take a bunch of functions in
  (fn [  args ]  ;; we take the arguments of the resulting function in.
(letfn [(value-my-comp ;; the value of the result in term of the
 functions is:
([f] (apply f args))   ;; only one function
([f1  f2-fn] (f1 (apply value-my-comp f2-fn]  ;;
 more than one function
   (apply value-my-comp fs  ;; we compute the value of the
 actual function we got.

 If you don't like (apply value-my-comp f2-fn), you can make
 value-my-comp actually takes a sequence
 of functions:

 (fn [ fs] ;; take the functions
  (fn [  args ]  ;; the arguments of the resulting functions
(letfn [(value-my-comp
 [[f1  f2-fn]]  ;; a list of functions
   (if (empty? f2-fn)  ;; only one function?
   (apply f1 args)  ;; then we apply the args to it
   (f1 (value-my-comp f2-fn] ;; else we compose
   (value-my-comp fs
 This one is another way of writing the one you posted.
 (Using a let instead of applying it directly, and not using a
 non-varying argument a.)

 If you want to see how this function can be written to be very
 performant look at
 comp source code, it is very interesting.

 Best,

 Nicolas.

 --
 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
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

[ANN] nio: Clojure support for java.nio

2012-08-25 Thread Paul Stadig
I have done a little library to provide better support in Clojure for
java.nio. It covers three main areas: 1) extending clojure.java.io to
cover java.nio type where reasonable, 2) providing a set of coercion
functions for java.nio types (similar to those for java.io provided by
clojure.java.io), and 3) provides buffer-seq, buffer-nth, and
buffer-to-array so that Buffers can get some of the niceness of
Clojure's seq abstractions, etc.

I brought this topic up on the clojure-dev mailing list. I would like
to see the buffer-seq, buffer-nth, and buffer-to-array work integrated
better into Clojure, and there is still discussion happening around
that. Otherwise, this work could just remain a separate library, or
perhaps it could be rolled into clojure.java.io.

Whatever the case, please use it and I would appreciate any feedback.

https://github.com/pjstadig/nio
https://clojars.org/nio

Paul

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


'functional' performance VS 'imperative' complexity

2012-08-25 Thread Jim - FooBar();

Hello everyone,

in this post I'm not asking for something specific, but rather I'd like 
to spark a  discussion regarding the issue of performance within the 
functional paradigm...most of the things i will mention will probably 
not be news for most of you...Hopefully, however the issues I plan to 
raise will eventualy help someone else faced with the same dilemmas as me...


First of all, let me clarify upfront that I strongly believe that 
'functional' and 'immutable' should be the default (as Rich often says). 
This thread is certainly not about praising the 'imperative' style. It 
is about having all the facts  before you start coding (probably before 
even designing)...Most of you presumably already do...


Ok so, it is evident from my other posts that I'm building a library for 
writing board games. In a nutshell, when it's finished, I'd like someone 
else to be able to write up his own board game, show it up on screen and 
genetically train a neural-net for an opponent, in literally less than 
5-6 hours (~ 100 LOC).
Now, for those of you that have done any board games you can immediately 
identify the hot-spots of such a program. These are 2: actually 
exploring the game-tree and training the neural-net. Notice how both 
these tasks can be run in parallel...(exploring the game tree is not 
immediately apparent how to do in parallel but we have reducers)...


Generally there are 3 major ways going about writing a program - 
functionally all the way, imperatively all the way, a mixture. I sort of 
implemented all 3 categories for my chess game and I've got some 
interesting results:


1. Firstly and more importantly (I mean that), the purely functional
   and immutable road is simply  such a pleasure to travel...There are
   no words to describe the beauty, clarity and elegance of the
   functional version. Mutation is non-existent or only through
   reference types and operations like 'update-position' and 'move'
   return brand new piece and board respectively. Also, it is the only
   one that is extremely stable and always brings back the correct
   answer. It is *gorgeous*... On the flip-side, it performs horrible!
   It is very very slow for realistic depths like 4 or 6 even
   regardless of utilising reducers to the maximum and countless
   optimisations. The best time I can report is 9 min for level 4.
2. after watching Daniel Solano Gomez's presentation on infoq (11 tips
   to boost performance), I realised that If I wanted raw speed (as he
   puts it), I 'd have to resort to arrays. Well, I made my heart a
   stone and went to implement an array-based version that favours
   mutation. Having such modular code in the first place, that did not
   take too long...I just wrote up different version of 'move' and
   'collides?' (amove, acollides?) that know how to deal with arrays
   and created a ChessPiece2 record which holds a java.awt.Point object
   which is mutated by update-position (instead of returning a brand
   new piece). Basically,  (I thought) i was done in 30 min... However
   it turned out I was being sooo ignorant!!! Making such a u-turn in
   programming paradigms while working on the same project is never
   that simple. The functional style protected me from so many bad
   things...of course, I already knew that but I was surprised to see
   how many these are! For instance, making a move in the functional
   version caused absolutely no damage...there is an 'execute!' fn that
   does damage if we want it to (via atom only) but this is to be used
   only when we decide what move we want. Now, trying out a move messes
   up everything!!! Now, I need means of undoing and not only that...My
   entire searching algorithm can no longer function properly...Off the
   top of my head, I need some sort of serial loop/recur that tries
   moves when recursion rolls in and takes them back (by undoing) when
   recursion rolls out . In other words I need to keep track of the
   changes carefully! On the filp-side, even though this version has
   bugs and does not return the correct answer, it seems it can reach
   level 4 in roughly 2 min. This is 4x faster! Again, I'm being
   cautious cos there are bugs so I can't be sure of the time but there
   seems to be a dramatic performance increase...The code however is a
   lot buggier and uglier...
3. Finally I tried doing a functional version that uses mutable arrays
   but doesn't mutate them...Instead critical fns like 'move' build new
   arrays (btw 'aclone' does not deep copy) to return and updating a
   piece's position does return a new piece... This version, is not
   very stable but does return the correct answer in just over 7 min
   for level 4...again the importance of immutability shines! the
   timing shows that i got 22%  better performance. I have not profiled
   this but I expect most of the time being spent copying arrays.


In essence what am I telling you here? 2 things basically... Firstly, 
think about performance before 

Odd residual exception behaviour at the repl

2012-08-25 Thread John Gabriele
Ran into something odd. Not sure if it's a bug.

In the repl, if I try `(def x ^{:a 1} 42)`, I get an exception (right,
since I can't assign metadata to the value 42).

But then after that, if I try something else (say, typing hi into
the repl), I get a 2nd exception message. Here's an example:

~~~
user= (def x ^{:a 1} 42)
#IllegalArgumentException java.lang.IllegalArgumentException:
Metadata can only be applied to IMetas

#RuntimeException java.lang.RuntimeException: Unmatched delimiter: )

user= hi
IllegalArgumentException Metadata can only be applied to IMetas
clojure.lang.LispReader$MetaReader.invoke (LispReader.java:740)
RuntimeException Unmatched delimiter: )
clojure.lang.Util.runtimeException (Util.java:170)
hi
user= hi
hi
user=
~~~

This is using lein 2 preview 8, Clojure 1.4, with OpenJDK 1.7.

---John

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: [ANN] Leiningen 2.0.0-preview9 released

2012-08-25 Thread Phil Hagelberg
Sam Aaron samaa...@gmail.com writes:

 I'm having a problem upgrading due to SSL certificate issues

 (I'm running OS X 10.8.1)

Hmmm; you should be seeing a message from Leiningen about how to disable
certificate checking by exporting HTTP_CLIENT. Is the message you
included the complete output, or did you truncate it at all?

-Phil

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: [ANN] Leiningen 2.0.0-preview9 released

2012-08-25 Thread Phil Hagelberg
Phil Hagelberg p...@hagelb.org writes:

 Sam Aaron samaa...@gmail.com writes:

 I'm having a problem upgrading due to SSL certificate issues

 (I'm running OS X 10.8.1)

 Hmmm; you should be seeing a message from Leiningen about how to disable
 certificate checking by exporting HTTP_CLIENT. Is the message you
 included the complete output, or did you truncate it at all?

Never mind; I see that message is only displayed during failed
self-installs, not failed upgrades. Will fix.

-Phil

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Odd residual exception behaviour at the repl

2012-08-25 Thread Colin Jones
It's a bug in reply. I've opened up an issue to get it fixed - thanks for 
the report.

https://github.com/trptcolin/reply/issues/80



On Saturday, August 25, 2012 3:06:28 PM UTC-5, John Gabriele wrote:

 Ran into something odd. Not sure if it's a bug. 

 In the repl, if I try `(def x ^{:a 1} 42)`, I get an exception (right, 
 since I can't assign metadata to the value 42). 

 But then after that, if I try something else (say, typing hi into 
 the repl), I get a 2nd exception message. Here's an example: 

 ~~~ 
 user= (def x ^{:a 1} 42) 
 #IllegalArgumentException java.lang.IllegalArgumentException: 
 Metadata can only be applied to IMetas 

 #RuntimeException java.lang.RuntimeException: Unmatched delimiter: ) 

 user= hi 
 IllegalArgumentException Metadata can only be applied to IMetas 
 clojure.lang.LispReader$MetaReader.invoke (LispReader.java:740) 
 RuntimeException Unmatched delimiter: ) 
 clojure.lang.Util.runtimeException (Util.java:170) 
 hi 
 user= hi 
 hi 
 user= 
 ~~~ 

 This is using lein 2 preview 8, Clojure 1.4, with OpenJDK 1.7. 

 ---John 


-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: 'functional' performance VS 'imperative' complexity

2012-08-25 Thread Dennis Haupt
+1

i stay functional if possible and fall back to mutable on isolated,
performance critical spots if i can't get it done fast enough in a
purely functional way.

i solved the move-mess-up-everything problem by forcing a move to
implement both apply and unapply on a game board. (it was a java
project). this way, i could still safely try a move and undo it in
secret - and i could still  use multithreading by making one copy of a
board per thread.

however, depending on the game, the single thread version was up to 10x
faster because of being able to cut off large portions of the tree while
the multithread version had less information per branch and could not
simply share it while travering the tree of possibilities.


Am 25.08.2012 22:01, schrieb Jim - FooBar();:
 Hello everyone,
 
 in this post I'm not asking for something specific, but rather I'd like
 to spark a  discussion regarding the issue of performance within the
 functional paradigm...most of the things i will mention will probably
 not be news for most of you...Hopefully, however the issues I plan to
 raise will eventualy help someone else faced with the same dilemmas as me...
 
 First of all, let me clarify upfront that I strongly believe that
 'functional' and 'immutable' should be the default (as Rich often says).
 This thread is certainly not about praising the 'imperative' style. It
 is about having all the facts  before you start coding (probably before
 even designing)...Most of you presumably already do...
 
 Ok so, it is evident from my other posts that I'm building a library for
 writing board games. In a nutshell, when it's finished, I'd like someone
 else to be able to write up his own board game, show it up on screen and
 genetically train a neural-net for an opponent, in literally less than
 5-6 hours (~ 100 LOC).
 Now, for those of you that have done any board games you can immediately
 identify the hot-spots of such a program. These are 2: actually
 exploring the game-tree and training the neural-net. Notice how both
 these tasks can be run in parallel...(exploring the game tree is not
 immediately apparent how to do in parallel but we have reducers)...
 
 Generally there are 3 major ways going about writing a program -
 functionally all the way, imperatively all the way, a mixture. I sort of
 implemented all 3 categories for my chess game and I've got some
 interesting results:
 
  1. Firstly and more importantly (I mean that), the purely functional
 and immutable road is simply  such a pleasure to travel...There are
 no words to describe the beauty, clarity and elegance of the
 functional version. Mutation is non-existent or only through
 reference types and operations like 'update-position' and 'move'
 return brand new piece and board respectively. Also, it is the only
 one that is extremely stable and always brings back the correct
 answer. It is *gorgeous*... On the flip-side, it performs horrible!
 It is very very slow for realistic depths like 4 or 6 even
 regardless of utilising reducers to the maximum and countless
 optimisations. The best time I can report is 9 min for level 4.
  2. after watching Daniel Solano Gomez's presentation on infoq (11 tips
 to boost performance), I realised that If I wanted raw speed (as he
 puts it), I 'd have to resort to arrays. Well, I made my heart a
 stone and went to implement an array-based version that favours
 mutation. Having such modular code in the first place, that did not
 take too long...I just wrote up different version of 'move' and
 'collides?' (amove, acollides?) that know how to deal with arrays
 and created a ChessPiece2 record which holds a java.awt.Point object
 which is mutated by update-position (instead of returning a brand
 new piece). Basically,  (I thought) i was done in 30 min... However
 it turned out I was being sooo ignorant!!! Making such a u-turn in
 programming paradigms while working on the same project is never
 that simple. The functional style protected me from so many bad
 things...of course, I already knew that but I was surprised to see
 how many these are! For instance, making a move in the functional
 version caused absolutely no damage...there is an 'execute!' fn that
 does damage if we want it to (via atom only) but this is to be used
 only when we decide what move we want. Now, trying out a move messes
 up everything!!! Now, I need means of undoing and not only that...My
 entire searching algorithm can no longer function properly...Off the
 top of my head, I need some sort of serial loop/recur that tries
 moves when recursion rolls in and takes them back (by undoing) when
 recursion rolls out . In other words I need to keep track of the
 changes carefully! On the filp-side, even though this version has
 bugs and does not return the correct answer, it seems it can reach
 level 4 in roughly 2 min. This is 4x 

Re: A Performance Comparison of SBCL Clojure

2012-08-25 Thread Mark Watson
Hello Ray,

Just a factor of 3 slower is pretty good :-)

The increased memory use is more disturbing to me since I often use
Clojure+Noir for deploying small web services and web apps. The extra
memory is more of a hassle than slightly slower execution speed.

Best regards,
Mark


On Sat, Aug 25, 2012 at 1:51 PM, Raymond de Lacaze dela...@hotmail.com wrote:
 Folks,



 Here’s a performance benchmark comparison of SBCL and Clojure.



 http://shootout.alioth.debian.org/u32/benchmark.php?test=alllang=clojurelang2=sbcl



 Interesting…



 --rpl



 Raymond Pierre de Lacaze

 dela...@hotmail.com





-- 
Mark Watson, consultant and author: http://markwatson.com

It is better to travel well than to arrive. - Buddha

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: problem 58 on 4clojure

2012-08-25 Thread John Holland
OK, I think I'm starting to get it now - the idea is a function that
accepts x  xs , which are functions, and returns a function which has
a var-args arity [ args], which is the composition of the xs.

Thanks to all for the replies - I still haven't looked at the source
to comp but it will be fun to see.



On Sat, Aug 25, 2012 at 2:46 PM, John Holland jbholl...@gmail.com wrote:
 Thanks to a for the replies. I will study them later when I am free.

 On Aug 25, 2012 2:37 PM, nicolas.o...@gmail.com nicolas.o...@gmail.com
 wrote:

 Here's my take:

 We want to define a function my-comp. It takes n functions and return
 their composition.
 We want to return a function of any number of arguments, so let's
 start by working with a given
 set of argument args, and returning the value of the composition
 applied to those arguments.

 - If I compose only one function, you get the value of the function
 itself:
   (value-my-comp f)  = (apply f args)

 - By definition of composition:
  (value-my-comp f1 f2  fn)  = (f1 (value-my-comp f2  fn))
 (Take all the arguments, apply it to the composition of function f2
  fn, and then apply the result to f1).

 Then you remove the dots:

 (value-my-comp f1  f2-fn) =  (f1  (apply value-my-comp f2-fn))

 Then you can just put them all together:


 (fn [ fs] ;; we take a bunch of functions in
  (fn [  args ]  ;; we take the arguments of the resulting function in.
(letfn [(value-my-comp ;; the value of the result in term of the
 functions is:
([f] (apply f args))   ;; only one function
([f1  f2-fn] (f1 (apply value-my-comp f2-fn]  ;;
 more than one function
   (apply value-my-comp fs  ;; we compute the value of the
 actual function we got.

 If you don't like (apply value-my-comp f2-fn), you can make
 value-my-comp actually takes a sequence
 of functions:

 (fn [ fs] ;; take the functions
  (fn [  args ]  ;; the arguments of the resulting functions
(letfn [(value-my-comp
 [[f1  f2-fn]]  ;; a list of functions
   (if (empty? f2-fn)  ;; only one function?
   (apply f1 args)  ;; then we apply the args to it
   (f1 (value-my-comp f2-fn] ;; else we compose
   (value-my-comp fs
 This one is another way of writing the one you posted.
 (Using a let instead of applying it directly, and not using a
 non-varying argument a.)

 If you want to see how this function can be written to be very
 performant look at
 comp source code, it is very interesting.

 Best,

 Nicolas.

 --
 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
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en



-- 

__

Note new email address jbholl...@gmail.com

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Can CLJS functions have metadata?

2012-08-25 Thread Shantanu Kumar


On Saturday, 25 August 2012 22:06:28 UTC+5:30, David Nolen wrote:

 On Sat, Aug 25, 2012 at 3:49 AM, Shantanu Kumar 
 kumar.s...@gmail.com javascript: wrote: 
  Hi, 
  
  I noticed that `with-meta` is not working on function objects in CLJS. 
  Compilation fails with the following error: 
  
  Error: No protocol method IWithMeta.-with-meta defined for type 
 function: 
  function (maps, x) { 
return x; 
  } 

 It's not currently supported. Ticket welcome. If you have ideas about 
 a good approach that's even better. Part of the problem is that 
 Clojure fns are just JS fns.


Filed the issue here: http://dev.clojure.org/jira/browse/CLJS-359

Storing metadata probably would need to store the fn as an internal Clojure 
representation, which might lead to indirection with performance 
implications on fn invocation?

Shantanu

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Can CLJS functions have metadata?

2012-08-25 Thread Timothy Baldridge
 It's not currently supported. Ticket welcome. If you have ideas about
 a good approach that's even better. Part of the problem is that
 Clojure fns are just JS fns.



Can't we just set the attribute on the function? This works under Chrome,
not sure about other browsers:

z = function(x) { return x;}
function (x) { return x;}
z(1)
1
z.foo = 1
1
z
function (x) { return x;}
z.foo
1
z(1)
1


This is the approach I took for clojure-py. You can either provide a
.meta() method that will be called to get the metadata, or you can put
._meta on your object and that attribute will be set/retrieved instead. Of
course, this isn't immutable, but it would support meta and alter-meta.

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

emacs error: Package `clojure-mode' is not available for installation

2012-08-25 Thread Menelaos Perdikeas
I am following the instructions on:

https://github.com/technomancy/clojure-mode/blob/master/README.md

on how to setup emacs with Clojure-mode.
I am running GNU Emacs 23.3.1 in Ubuntu. Launching my Emacs fails with:

error: Package `clojure-mode' is not available for installation 
   

The relevant section of my .emacs file is:

  (if   
  
  (= emacs-major-version 23)
  
  (load package)   
  ) 
  

  
  (progn 
  (require 'package)
  
  (add-to-list 'package-archives
  
   '(marmalade, http://marmalade-repo.org/packages;))
  
  (package-initialize)  
  
  ) 
  

  
  (progn ;; Clojure mode and Paredit
  
  (when (not (package-installed-p 'clojure-mode))   
  
(package-install 'clojure-mode))
  
  (if nil ;; turn Paredit off for now   
  
  (when (not (package-installed-p 'paredit))
  
(package-install 'paredit)  
  
  ) 
  
  (progn ;; Paredit 
  
  ;; (require 'paredit) if you didn't install via package.el
  
  (defun turn-on-paredit () (paredit-mode 1))   
  
  (add-hook 'clojure-mode-hook 'turn-on-paredit)
  
  ) 
  
  ) 
  
  )




-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: emacs error: Package `clojure-mode' is not available for installation

2012-08-25 Thread Peter Buckley
I had various issues with clojure-mode, swank, slime, etc. with emacs 23 until 
I switched to emacs 24. 

Emacs 24 is much simpler to download now (don't have to compile from source) 
and is likely the quickest solution to all your clojure/emacs issues.

-Original Message-
From: Menelaos Perdikeas mperdik...@gmail.com
Sender: clojure@googlegroups.com
Date: Sat, 25 Aug 2012 22:35:52 
To: clojure@googlegroups.com
Reply-To: clojure@googlegroups.com
Subject: emacs error: Package `clojure-mode' is not available for installation

I am following the instructions on:

https://github.com/technomancy/clojure-mode/blob/master/README.md

on how to setup emacs with Clojure-mode.
I am running GNU Emacs 23.3.1 in Ubuntu. Launching my Emacs fails with:

error: Package `clojure-mode' is not available for installation 
   

The relevant section of my .emacs file is:

  (if   
  
  (= emacs-major-version 23)
  
  (load package)   
  ) 
  

  
  (progn 
  (require 'package)
  
  (add-to-list 'package-archives
  
   '(marmalade, http://marmalade-repo.org/packages;))
  
  (package-initialize)  
  
  ) 
  

  
  (progn ;; Clojure mode and Paredit
  
  (when (not (package-installed-p 'clojure-mode))   
  
(package-install 'clojure-mode))
  
  (if nil ;; turn Paredit off for now   
  
  (when (not (package-installed-p 'paredit))
  
(package-install 'paredit)  
  
  ) 
  
  (progn ;; Paredit 
  
  ;; (require 'paredit) if you didn't install via package.el
  
  (defun turn-on-paredit () (paredit-mode 1))   
  
  (add-hook 'clojure-mode-hook 'turn-on-paredit)
  
  ) 
  
  ) 
  
  )




-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

-- 
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 

Re: [ANN] Leiningen 2.0.0-preview9 released

2012-08-25 Thread Sam Aaron
Awesome, thanks.

On 25 Aug 2012, at 21:52, Phil Hagelberg p...@hagelb.org wrote:

 Phil Hagelberg p...@hagelb.org writes:
 
 Sam Aaron samaa...@gmail.com writes:
 
 I'm having a problem upgrading due to SSL certificate issues
 
 (I'm running OS X 10.8.1)
 
 Hmmm; you should be seeing a message from Leiningen about how to disable
 certificate checking by exporting HTTP_CLIENT. Is the message you
 included the complete output, or did you truncate it at all?
 
 Never mind; I see that message is only displayed during failed
 self-installs, not failed upgrades. Will fix.
 
 -Phil
 
 -- 
 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
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


[ANN] Leiningen 2.0.0-preview10 released

2012-08-25 Thread Phil Hagelberg

I just pushed out version 2.0.0-preview10 of Leiningen.

The only differences since preview9 are these:

* Fix a bug where repositories wouldn't be checked running outside a project.
* Make repl listen on 127.0.0.1 instead of localhost to address IPv6 issues.
* Show how to turn off certificate checking when doing upgrade.

As usual, `lein upgrade` will get you the latest version if you're
already running a 2.x preview.

Please report any problems via GitHub issues or the mailing list.

Thanks,
Phil

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Particle system with Quil

2012-08-25 Thread meteorfox
I've been working in a particle system using Quil for rendering, which I'm 
calling Newtonian for now ;) , just to practice some of the concepts of 
protocols and defrecords. The project is still WIP. Any feedback will be 
appreciate it.

github.com:
https://github.com/meteorfox/newtonian

Vimeo: (Warning: Looks choppy in the video, because the frame rate I used 
when I recorded it) 
https://vimeo.com/48222827 

Thanks!

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Emacs 23 error: Package `clojure-mode' is not available for installation

2012-08-25 Thread mperdikeas
I am using* Emacs GNU Emacs 23.3.1* on Ubuntu and I am following the 
instructions found here:

https://github.com/technomancy/clojure-mode/blob/master/README.md

on how to setup clojure-mode for Emacs. But launching my Emacs reports the 
following error:

error: Package `clojure-mode' is not available for installation 

This is the relevant section of my *.emacs* file:

(if 
 
(= emacs-major-version 23) 
  
(load package) 
)   
 

 
(require 'package) 
  
(add-to-list 'package-archives 
  
 '(marmalade . http://marmalade-repo.org/packages/;))   
  
(package-initialize)   
  

 
(progn 
(when (not (package-installed-p 'clojure-mode)) 
 
  (package-install 'clojure-mode)) 

 
)

Any ideas ? Should I perhaps download *clojure-mode.el* and then load it 
manually in my *.emacs* ?

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

how to disconnect/quit the repl in nrepl.el?

2012-08-25 Thread Shanmu
Hi All,
Is there a way to disconnect/quit the repl in nrepl.el cleanly?

Thanks,
Shanmu.

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: A Performance Comparison of SBCL Clojure

2012-08-25 Thread Stuart Sierra
The Alioth benchmarks are somewhat unfair to JVM languages because they 
include startup time for the JVM itself and often don't run enough 
iterations to engage the optimizer.
-S

On Sat, Aug 25, 2012 at 1:51 PM, Raymond de Lacaze 
del...@hotmail.comjavascript: 
 wrote: 
  Here’s a performance benchmark comparison of SBCL and Clojure. 
  
 http://shootout.alioth.debian.org/u32/benchmark.php?test=alllang=clojurelang2=sbcl
  



-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en