recursive specs

2016-06-09 Thread Frederic Peschanski
Hi there,

I have been playing a little bit with clojure.spec and I find it a very 
nice addition to the core language.
One thing I am particularly interested in is the spec of recursive 
structures, but I noticed there
 is no dedicated support for these (especially mutually recursive 
structures).

As a toy example, I have encoded a spec for constructive even/odd numbers.

;; ==
(:require [clojure.spec :as s]))
(s/def ::zero #{:zero})
(s/def ::one #{:one})
(s/def ::succ #{:succ})
(s/def ::odd nil)
(s/def ::even (s/or :zero ::zero   ; 0 is even
  :even (s/tuple ::succ ::odd)))  ; n+1 is even if 
n is odd
(s/def ::odd (s/tuple ::succ ::even)) ; n+1 is odd if n is even
;; ==

First question : is there a better way to define a set of mutually 
recursive specs ?

This seems to work anyways :

;; ===
(s/conform ::even :zero) ; zero is even
;; => [:zero :zero]
(s/conform ::even [:succ [:succ :zero]]) ; 2 is even
;; => [:even [:succ [:succ [:zero :zero

(s/exercise ::even)
;; => generates 10 even numbers  (nice !)
(s/conform ::odd [:succ :zero]) ; 1 is odd
;; => [:succ [:zero :zero]]
(s/conform ::odd [:succ [:succ :zero]]) ; 2 is not odd
;; => :clojure.spec/invalid
;; ==

My main concern is when asking for some explanations for invalid data.

;; 
(s/explain ::odd [:succ [:succ :zero]])
;; In: [1] val: [:succ :zero] fails spec: :typetheory.syntax/zero at: [1 
:zero] predicate: #{:zero}
;; In: [1 1] val: :zero fails spec: :typetheory.syntax/odd at: [1 :even 1] 
predicate: vector?
;; => nil
;; 

I think the explanation will be of a size as long as the length of the 
input data,
 and moreover it is not easy to understand what is the problem...

so, my second question : is there a way to get a better explanation ?

Cheers,
Frederic.

-- 
Frederic Peschanski
UPMC - LIP6 - Complex. - APR

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: recursive specs

2016-06-09 Thread Christophe Grand
Hi Frédéric,

On Thu, Jun 9, 2016 at 2:21 PM, Frederic Peschanski <
frederic.peschanski.w...@gmail.com> wrote:

> ;; ==
> (:require [clojure.spec :as s]))
> (s/def ::zero #{:zero})
> (s/def ::one #{:one})
> (s/def ::succ #{:succ})
> (s/def ::odd nil)
> (s/def ::even (s/or :zero ::zero   ; 0 is even
>   :even (s/tuple ::succ ::odd)))  ; n+1 is even if
> n is odd
> (s/def ::odd (s/tuple ::succ ::even)) ; n+1 is odd if n is even
> ;; ==
>
> First question : is there a better way to define a set of mutually
> recursive specs ?
>

No it's ok but you can remove (s/def ::odd nil).

Christophe

-- 
On Clojure http://clj-me.cgrand.net/
Clojure Programming http://clojurebook.com
Training, Consulting & Contracting http://lambdanext.eu/

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Clojure 1.9.0-alpha5

2016-06-09 Thread Alex Miller
I think it's quite likely that you have multiple copies of tools.analyzer 
(and possibly other libs) on your classpath. Can you take a look at your 
deps and see if that might be the case?

A particular thing to watch for is if any dep is AOT compiled and 
transitively pulled in a dependency lib somehow.

"lein deps :tree" is a good place to start, but it doesn't tell you what's 
actually inside the jars. There used to be a Maven plugin that would track 
down multiple class definitions across the dependency classpath, can't 
remember what it was called. It would be cool if such a thing also existed 
for Lein that would find multiple .clj/.cljc/.class files for a ns on the 
classpath. Or maybe someone has already written that, don't know.


On Wednesday, June 8, 2016 at 5:13:20 PM UTC-5, Rangel Spasov wrote:
>
> Hey guys - getting this compiler exception when I tried alpha 5 (up to 
> alpha 4 it was all good).
>
> WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: 
> clojure.tools.analyzer.utils, being replaced by: 
> #'clojure.tools.analyzer.utils/boolean?
>
> WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: 
> clojure.tools.analyzer, being replaced by: 
> #'clojure.tools.analyzer.utils/boolean?
>
> #error {
>
>  :cause Attempting to call unbound fn: 
> #'clojure.tools.analyzer.utils/boolean?
>
>  :via
>
>  [{:type clojure.lang.Compiler$CompilerException
>
>:message java.lang.IllegalStateException: Attempting to call unbound 
> fn: #'clojure.tools.analyzer.utils/boolean?, 
> compiling:(manifold/stream/async.clj:62:16)
>
>:at [clojure.lang.Compiler analyzeSeq Compiler.java 6890]}
>
>   {:type java.lang.IllegalStateException
>
>:message Attempting to call unbound fn: 
> #'clojure.tools.analyzer.utils/boolean?
>
>:at [clojure.lang.Var$Unbound throwArity Var.java 43]}]
>
>  :trace
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Clojure 1.9.0-alpha5

2016-06-09 Thread Alex Miller
The use of named? inside spec will be replaced with ident?.

On Wednesday, June 8, 2016 at 3:13:12 PM UTC-5, Devin Walters (devn) wrote:
>
> Any chance of `named?` making the cut in 1.9? I see it's used in the 
> implementation of clojure.spec.
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Clojure 1.9.0-alpha5

2016-06-09 Thread Alex Miller
Whoops. That is an oversight.

On Wednesday, June 8, 2016 at 11:34:13 AM UTC-5, David Powell wrote:
>
>
> Do uri? and bytes? really have generator support implemented?  I couldn't 
> seem to get that to work.
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Clojure 1.9.0-alpha5

2016-06-09 Thread Alex Miller

On Wednesday, June 8, 2016 at 3:23:51 AM UTC-5, Mamun wrote:
>
> Excellent set of new predicates. What about date predicate? 
>
> It would be nice if there are also date predicate as an example in bellow
>
> date?  
>

Use clojure.core/inst?
 

> date-past?
> date-future?
>

You can use the new clojure.spec/inst-in-range? predicate to check inst 
ranges. We could consider something that would do open ranges too if you 
wanted to file a jira for that. 

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Clojure 1.9.0-alpha5

2016-06-09 Thread Nicola Mometto
I commented about this in the #clojure-dev slack channel, I believe 
http://dev.clojure.org/jira/browse/CLJ-1874 to be the cause of this issue


> On 9 Jun 2016, at 14:32, Alex Miller  wrote:
> 
> I think it's quite likely that you have multiple copies of tools.analyzer 
> (and possibly other libs) on your classpath. Can you take a look at your deps 
> and see if that might be the case?
> 
> A particular thing to watch for is if any dep is AOT compiled and 
> transitively pulled in a dependency lib somehow.
> 
> "lein deps :tree" is a good place to start, but it doesn't tell you what's 
> actually inside the jars. There used to be a Maven plugin that would track 
> down multiple class definitions across the dependency classpath, can't 
> remember what it was called. It would be cool if such a thing also existed 
> for Lein that would find multiple .clj/.cljc/.class files for a ns on the 
> classpath. Or maybe someone has already written that, don't know.
> 
> 
> On Wednesday, June 8, 2016 at 5:13:20 PM UTC-5, Rangel Spasov wrote:
> Hey guys - getting this compiler exception when I tried alpha 5 (up to alpha 
> 4 it was all good).
> 
> WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: 
> clojure.tools.analyzer.utils, being replaced by: 
> #'clojure.tools.analyzer.utils/boolean?
> 
> WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: 
> clojure.tools.analyzer, being replaced by: 
> #'clojure.tools.analyzer.utils/boolean?
> 
> #error {
> 
>  :cause Attempting to call unbound fn: #'clojure.tools.analyzer.utils/boolean?
> 
>  :via
> 
>  [{:type clojure.lang.Compiler$CompilerException
> 
>:message java.lang.IllegalStateException: Attempting to call unbound fn: 
> #'clojure.tools.analyzer.utils/boolean?, 
> compiling:(manifold/stream/async.clj:62:16)
> 
>:at [clojure.lang.Compiler analyzeSeq Compiler.java 6890]}
> 
>   {:type java.lang.IllegalStateException
> 
>:message Attempting to call unbound fn: 
> #'clojure.tools.analyzer.utils/boolean?
> 
>:at [clojure.lang.Var$Unbound throwArity Var.java 43]}]
> 
>  :trace
> 
> 
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [ANN] Clojure 1.9.0-alpha5

2016-06-09 Thread Fluid Dynamics
On Thursday, June 9, 2016 at 9:32:51 AM UTC-4, Alex Miller wrote:
>
> I think it's quite likely that you have multiple copies of tools.analyzer 
> (and possibly other libs) on your classpath. Can you take a look at your 
> deps and see if that might be the case?
>
> A particular thing to watch for is if any dep is AOT compiled and 
> transitively pulled in a dependency lib somehow.
>
> "lein deps :tree" is a good place to start, but it doesn't tell you what's 
> actually inside the jars. There used to be a Maven plugin that would track 
> down multiple class definitions across the dependency classpath, can't 
> remember what it was called. It would be cool if such a thing also existed 
> for Lein that would find multiple .clj/.cljc/.class files for a ns on the 
> classpath. Or maybe someone has already written that, don't know.
>

A tool like unix commandline "which" could also help in such circumstances, 
to find out exactly which jar or clj file for what namespace a function or 
other Var is coming from. Something like

=> (which boolean?)
clojure.tools.analyzer.utils/boolean? in /some/path/clojure.jar

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Clojure 1.9.0-alpha5

2016-06-09 Thread Herwig Hochleitner
2016-06-09 15:32 GMT+02:00 Alex Miller :

>
> "lein deps :tree" is a good place to start, but it doesn't tell you what's
> actually inside the jars. There used to be a Maven plugin that would track
> down multiple class definitions across the dependency classpath, can't
> remember what it was called. It would be cool if such a thing also existed
> for Lein that would find multiple .clj/.cljc/.class files for a ns on the
> classpath. Or maybe someone has already written that, don't know.
>

Indeed, I have written `lein-collisions` for this purpose:
https://github.com/webnf/lein-collisions

I don't think it would detect collisions between `.clj`, `.cljc` and
`.class` files right now. I'll put that on the todo list.

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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to Keep Clojure Server From Quitting

2016-06-09 Thread Nate Young
oh, perfect. aleph.netty/wait-for-close looks like exactly the kind of 
thing I wanted. thanks!


Andrea Richiardi wrote:


I do the following in my code (where system/http is a mount var, the
eval result of start-server):

(ns ...
(:require [aleph.netty :as netty])

(defn -main
[& args]
(mount/start args)
(netty/wait-for-close server/http))


On Wednesday, June 8, 2016 at 7:53:25 AM UTC-7, Nate Young wrote:

Good morning (at least from my part of the globe),

I spent a good chunk of time last night wondering why this chunk
of code
kept exiting about a minute after being run:


(ns narcoleptic.server
(:require [aleph.http :as http]
[compojure.core :as compojure :refer [GET]]
[compojure.route :as route]
[ring.middleware.params :as params]))

(def handler
(params/wrap-params
(compojure/routes
(GET "/" [] "Hello World!")
(route/not-found "Not Found"

(def server (agent nil))

(defn -main []
(send-off server #(or % (http/start-server handler {:port
9000}


until I found
http://tech.puredanger.com/2010/06/08/clojure-agent-thread-pools/
 which

explains that send-off pools die after a minute. Additionally, it
looks
like all of the thread pools that aleph creates are marked as daemon
threads, so the main thread dies after the send-off, the send-off
thread
dies after a minute and that leaves no non-daemon threads running, so
the JVM exits. Cool.

My question, then, is this: Is there a best practice for keeping a
thread open forever so that my server won't ever exit? I'd like to
`lein
run -m narcoleptic.server` and see that it stays up as long as
possible.

I've tried two solutions, but the first feels ike an awful lot of
typing
for a language that usually has the right tools close at hand and the
second feels like a hack and doesn't play as nicely in a REPL
environment (but they both work):

(1)

(defn wait-until-stopped []
(let [stopped (promise)]
(add-watch server :stop-wait
(fn [key server old-state new-state]
(when (= new-state :stopped)
(remove-watch server :stop-wait)
(deliver stopped :ok
@stopped))


(2)

;; removed the agents code
(def stopped (promise))
(defn -main []
(http/start-server handler {:port 9000})
@stopped)


Am I super off in the woods here? Any help/pointers/sage advice
appreciated. 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
---
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to clojure+unsubscr...@googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.


--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: recursive specs

2016-06-09 Thread Frederic Peschanski


Le jeudi 9 juin 2016 15:30:08 UTC+2, Christophe Grand a écrit :
>
> Hi Frédéric,
>
>
> First question : is there a better way to define a set of mutually 
> recursive specs ?
>
> No it's ok but you can remove (s/def ::odd nil).
>
>
Oh yes you're right ... thanks
 

> Christophe
>
> -- 
> On Clojure http://clj-me.cgrand.net/
> Clojure Programming http://clojurebook.com
> Training, Consulting & Contracting http://lambdanext.eu/ 
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


What is replacement to maven-assembly-plugin in boot-clj environment?

2016-06-09 Thread Jacek Grzebyta
I need to build more complex package using boot-cl. I have cited my request
put on the StackOverflow:

Copy of What is replacement to maven-assembly-plugin in boot-clj
environment? 

I created a project which (semi-) finally gives jar file. The file is for
> command line usage. In next step I would like to add a few shell scripts to
> call relevant classes within jar. Also I would like to keep externally
> log4j.xml file.
>
> The obvious next step is to build a package to bring all components
> together. However I could not find a replacement of maven-assembly-plugin
> for boot-clj builder.
>
> Maybe there is a way doing that without that plugin: I mean that maybe
> boot has some build-in feature that solve the issue?
>

Thanks a lot,
Jacek

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


why is it so annoying to run clojure code

2016-06-09 Thread Jiacai Liu
I  started learning clojure recently, and I am annoyed at the way to run it 
(aka. lein run). why clojure script can't be run like python,ruby or scala, 
like python .py

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: why is it so annoying to run clojure code

2016-06-09 Thread Shantanu Kumar
Consider http://inlein.org/ or https://github.com/kumarshantanu/lein-exec

HTH

Shantanu

On Thursday, 9 June 2016 21:38:39 UTC+5:30, Jiacai Liu wrote:
>
> I  started learning clojure recently, and I am annoyed at the way to run 
> it (aka. lein run). why clojure script can't be run like python,ruby or 
> scala, like python .py
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: why is it so annoying to run clojure code

2016-06-09 Thread Herwig Hochleitner
Leiningen is a tool external to clojure, that has project automation in
mind.
The equivalent to `python script.py` would be `java -jar clojure.jar -i
script.clj`.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: why is it so annoying to run clojure code

2016-06-09 Thread James Reeves
You can run Clojure directly, but often you don't just need Clojure, but
other libraries as well. The "lein run" command not only runs your code, it
also handles downloading any dependencies your code might have.

In Ruby terms, Leiningen is the equivalent of ruby + rbenv + bundler +
rake. I'm less familiar with the Python stack, but I believe python +
virtualenv + pip goes some way to having the same functionality.

- James

On 9 June 2016 at 17:08, Jiacai Liu  wrote:

> I  started learning clojure recently, and I am annoyed at the way to run
> it (aka. lein run). why clojure script can't be run like python,ruby or
> scala, like python .py
>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: why is it so annoying to run clojure code

2016-06-09 Thread Gary Trakhman
Why hasn't anyone mentioned Boot, which provides shebang-style execution
and deps for you? https://github.com/boot-clj/boot/wiki/Scripts

On Thu, Jun 9, 2016 at 12:48 PM James Reeves  wrote:

> You can run Clojure directly, but often you don't just need Clojure, but
> other libraries as well. The "lein run" command not only runs your code, it
> also handles downloading any dependencies your code might have.
>
> In Ruby terms, Leiningen is the equivalent of ruby + rbenv + bundler +
> rake. I'm less familiar with the Python stack, but I believe python +
> virtualenv + pip goes some way to having the same functionality.
>
> - James
>
> On 9 June 2016 at 17:08, Jiacai Liu  wrote:
>
>> I  started learning clojure recently, and I am annoyed at the way to run
>> it (aka. lein run). why clojure script can't be run like python,ruby or
>> scala, like python .py
>>
>> --
>> 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 unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Clojure 1.9.0-alpha5

2016-06-09 Thread Sean Corfield
On 6/9/16, 6:39 AM, "Nicola Mometto"  wrote:
> I commented about this in the #clojure-dev slack channel, I believe
> http://dev.clojure.org/jira/browse/CLJ-1874 to be the cause of this issue

Interesting. I didn’t have any AOT-compiled code in my situation as far as I 
know, but I do know I have multiple versions of some dependencies – I just 
assumed that because they seem to resolve to the version I want loaded that I 
had no problems (via boot show –p – which shows the “winning” version of each 
conflicted dependency).

Given Alex’s comment…

> On 9 Jun 2016, at 14:32, Alex Miller  wrote:
> I think it's quite likely that you have multiple copies of tools.analyzer 
> (and possibly other libs) on your classpath. Can you take a look at your deps 
> and see if that might be the case?

…I’m going to add more exclusions to just get rid of all my conflicts at this 
point, since I can’t be _certain_ that a transitive dependency doesn’t bring in 
AOT code.

Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood





-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: why is it so annoying to run clojure code

2016-06-09 Thread Miguel Ping
I highly recommend you to learn some kind of interactive tool for clojure, 
such as emacs+cider.

I wrote a mini tutorial about 
it: http://mping.github.io/2015/11/17/clojure-emacs-cider.html

On Thursday, June 9, 2016 at 5:08:39 PM UTC+1, Jiacai Liu wrote:
>
> I  started learning clojure recently, and I am annoyed at the way to run 
> it (aka. lein run). why clojure script can't be run like python,ruby or 
> scala, like python .py
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: why is it so annoying to run clojure code

2016-06-09 Thread Plínio Balduino
Thanks for the tutorial

On Thu, Jun 9, 2016 at 2:36 PM, Miguel Ping  wrote:

> I highly recommend you to learn some kind of interactive tool for clojure,
> such as emacs+cider.
>
> I wrote a mini tutorial about it:
> http://mping.github.io/2015/11/17/clojure-emacs-cider.html
>
> On Thursday, June 9, 2016 at 5:08:39 PM UTC+1, Jiacai Liu wrote:
>>
>> I  started learning clojure recently, and I am annoyed at the way to run
>> it (aka. lein run). why clojure script can't be run like python,ruby or
>> scala, like python .py
>>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is replacement to maven-assembly-plugin in boot-clj environment?

2016-06-09 Thread Gregg Reynolds
try the boot channel on clojurians on slack.  very responsive.
On Jun 9, 2016 10:46 AM, "Jacek Grzebyta"  wrote:

> I need to build more complex package using boot-cl. I have cited my
> request put on the StackOverflow:
>
> Copy of What is replacement to maven-assembly-plugin in boot-clj
> environment? 
>
> I created a project which (semi-) finally gives jar file. The file is for
>> command line usage. In next step I would like to add a few shell scripts to
>> call relevant classes within jar. Also I would like to keep externally
>> log4j.xml file.
>>
>> The obvious next step is to build a package to bring all components
>> together. However I could not find a replacement of maven-assembly-plugin
>> for boot-clj builder.
>>
>> Maybe there is a way doing that without that plugin: I mean that maybe
>> boot has some build-in feature that solve the issue?
>>
>
> Thanks a lot,
> Jacek
>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] pedestal-api 0.2.0 release - Swagger for pedestal

2016-06-09 Thread Oliver Hine
Hi everyone,

After the release of pedestal 0.5.0 I have updated pedestal-api 
 to make it compatible with the 
breaking changes.
Also in this release:

   - Better content negotiation
   - Support for query parameters that are all optional 
   
   - Better support for splat params 
   

You can read the release notes 
, the readme 
 or see the live example 
.

Cheers
Oliy

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] pedestal-api 0.2.0 release - Swagger for pedestal

2016-06-09 Thread Paul deGrandis
Congrats!

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] pedestal-api 0.2.0 release - Swagger for pedestal

2016-06-09 Thread Oliver Hine
Cheers Paul, for pedestal and your help!

On Thursday, 9 June 2016 20:18:01 UTC+1, Paul deGrandis wrote:
>
> Congrats!
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: why is it so annoying to run clojure code

2016-06-09 Thread hiskennyness


On Thursday, June 9, 2016 at 12:08:39 PM UTC-4, Jiacai Liu wrote:
>
> I  started learning clojure recently, and I am annoyed at the way to run 
> it (aka. lein run). why clojure script can't be run like python,ruby or 
> scala, like python .py
>

Having just gotten into Clojure, I have the same pain. But I am a long time 
Lisper, so I understand that this just means that Clojure is a true Lisp, 
because Lisps punish noobs in cruel and unusual ways.

And, yes, specifically I am astonished that I have never seen a clj or cljs 
repl without executing some opaque command-line sequence involving lein or 
boot or god knows what.

OTOH, I have already ported a rather intense library from Common Lisp to 
Clojure and then, oh, what the heck, ClojureScript as well, and am about to 
deliver a may to program mobile devices in ClojureScript. 

But I have an advantage: I know this aggravation is typical, and I know the 
wonders that await me if I ignore the wolf under my cloak for a month or 
two. And seeing my library running on my phone is just the first wonder.

If you are coming from a non-lisp, I can only guess at your frustration.

Trust me. Hang in there. Work through Brave Clojure until you are able to 
Actually Code Something(tm) and then run with it. That should get you to 
the point where you stop noticing the wolf.

Then you can write a guide to help other noobs such as yourself. But you 
will not*. You will not be able to stop coding. And that is why Lisps are 
so unapproachable!

hth. hk 

*  Actually, many good-hearted folks have taken time to help us noobs, or I 
would not still be here. :)

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Clojure 1.9.0-alpha5

2016-06-09 Thread Rangel Spasov
Add the latest tools.analyzer as a dependency solved the problem. 

[org.clojure/tools.analyzer "0.6.9"]

Thanks guys!

On Thursday, June 9, 2016 at 6:40:12 AM UTC-7, Nicola Mometto wrote:
>
> I commented about this in the #clojure-dev slack channel, I believe 
> http://dev.clojure.org/jira/browse/CLJ-1874 to be the cause of this issue 
>
>
> > On 9 Jun 2016, at 14:32, Alex Miller > 
> wrote: 
> > 
> > I think it's quite likely that you have multiple copies of 
> tools.analyzer (and possibly other libs) on your classpath. Can you take a 
> look at your deps and see if that might be the case? 
> > 
> > A particular thing to watch for is if any dep is AOT compiled and 
> transitively pulled in a dependency lib somehow. 
> > 
> > "lein deps :tree" is a good place to start, but it doesn't tell you 
> what's actually inside the jars. There used to be a Maven plugin that would 
> track down multiple class definitions across the dependency classpath, 
> can't remember what it was called. It would be cool if such a thing also 
> existed for Lein that would find multiple .clj/.cljc/.class files for a ns 
> on the classpath. Or maybe someone has already written that, don't know. 
> > 
> > 
> > On Wednesday, June 8, 2016 at 5:13:20 PM UTC-5, Rangel Spasov wrote: 
> > Hey guys - getting this compiler exception when I tried alpha 5 (up to 
> alpha 4 it was all good). 
> > 
> > WARNING: boolean? already refers to: #'clojure.core/boolean? in 
> namespace: clojure.tools.analyzer.utils, being replaced by: 
> #'clojure.tools.analyzer.utils/boolean? 
> > 
> > WARNING: boolean? already refers to: #'clojure.core/boolean? in 
> namespace: clojure.tools.analyzer, being replaced by: 
> #'clojure.tools.analyzer.utils/boolean? 
> > 
> > #error { 
> > 
> >  :cause Attempting to call unbound fn: 
> #'clojure.tools.analyzer.utils/boolean? 
> > 
> >  :via 
> > 
> >  [{:type clojure.lang.Compiler$CompilerException 
> > 
> >:message java.lang.IllegalStateException: Attempting to call unbound 
> fn: #'clojure.tools.analyzer.utils/boolean?, 
> compiling:(manifold/stream/async.clj:62:16) 
> > 
> >:at [clojure.lang.Compiler analyzeSeq Compiler.java 6890]} 
> > 
> >   {:type java.lang.IllegalStateException 
> > 
> >:message Attempting to call unbound fn: 
> #'clojure.tools.analyzer.utils/boolean? 
> > 
> >:at [clojure.lang.Var$Unbound throwArity Var.java 43]}] 
> > 
> >  :trace 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Clojure" group. 
> > To post to this group, send email to clo...@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+u...@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 unsubscribe from this group and stop receiving emails from it, send 
> an email to clojure+u...@googlegroups.com . 
> > For more options, visit https://groups.google.com/d/optout. 
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.