Re: case bug

2018-07-24 Thread Michael Gardner
As its docstring states, the `case` macro doesn't evaluate its test-constants. 
It only works on compile-time constants (e.g. literal strings/numbers), to 
allow O(1) matching. You want `condp` instead.

-- 
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: clojure test has 10 failures

2018-07-24 Thread 冯忠孝
(Throwable->map (Exception. "text"))
=>
{:cause "text",
 :via [{:type java.lang.Exception, :message "text", :at 
[skyapi.core$eval49477 invokeStatic "form-init4673008911594595642.clj" 1]}],
 :trace [[skyapi.core$eval49477 invokeStatic 
"form-init4673008911594595642.clj" 1]
 [skyapi.core$eval49477 invoke "form-init4673008911594595642.clj" 1]
 [clojure.lang.Compiler eval "Compiler.java" 7069]
 [clojure.lang.Compiler eval "Compiler.java" 7032]
 [clojure.core$eval invokeStatic "core.clj" 3206]
 [clojure.core$eval invoke "core.clj" 3202]
 [clojure.main$repl$read_eval_print__8730$fn__8733 invoke 
"main.clj" 243]
 [clojure.main$repl$read_eval_print__8730 invoke "main.clj" 243]
 [clojure.main$repl$fn__8739 invoke "main.clj" 261]
 [clojure.main$repl invokeStatic "main.clj" 261]
 [clojure.main$repl doInvoke "main.clj" 177]
 [clojure.lang.RestFn invoke "RestFn.java" 1523]

 [clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__33779 
invoke "interruptible_eval.clj" 87]
 [clojure.lang.AFn applyToHelper "AFn.java" 152]
 [clojure.lang.AFn applyTo "AFn.java" 144]
 [clojure.core$apply invokeStatic "core.clj" 657]
 [clojure.core$with_bindings_STAR_ invokeStatic "core.clj" 1965]
 [clojure.core$with_bindings_STAR_ doInvoke "core.clj" 1965]
 [clojure.lang.RestFn invoke "RestFn.java" 425]
 [clojure.tools.nrepl.middleware.interruptible_eval$evaluate 
invokeStatic "interruptible_eval.clj" 85]
 [clojure.tools.nrepl.middleware.interruptible_eval$evaluate invoke 
"interruptible_eval.clj" 55]

 
[clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__33824$fn__33827
  invoke
  "interruptible_eval.clj"
  222]

 [clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__33819 
invoke "interruptible_eval.clj" 190]
 [clojure.lang.AFn run "AFn.java" 22]
 [java.util.concurrent.ThreadPoolExecutor runWorker 
"ThreadPoolExecutor.java" 1142]
 [java.util.concurrent.ThreadPoolExecutor$Worker run 
"ThreadPoolExecutor.java" 617]
 [java.lang.Thread run "Thread.java" 745]]}

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


case bug

2018-07-24 Thread 冯忠孝


(def rechargecardflowname "rechargecard")
(def rechargedirectflowname "rechargedirect")
(def procurementstockflowname "procurementstock")
(defn abolish-name [flowname]
  (str "abolish1" flowname)
  )
(defn report-rechargecard [billid]
  )

(defn consume-msg [msgname billid]
  (case msgname
rechargecardflowname (report-rechargecard billid)
rechargedirectflowname (report-rechargecard billid)
procurementstockflowname (report-rechargecard billid)
(abolish-name rechargecardflowname) (report-rechargecard billid)
(abolish-name rechargedirectflowname) (report-rechargecard billid)
(abolish-name procurementstockflowname) (report-rechargecard billid)
;(ym/f {:uri "/mq/report/msgname"} (str msgname " - 没有匹配到该消息名称") 9000)
))


CompilerException java.lang.IllegalArgumentException: Duplicate case test 
constant: rechargecardflowname, compiling:(D:/onedam/routes/mq.clj:34:3) 


[org.clojure/clojure "1.10.0-alpha6"]

win10 jdk1.8

-- 
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: clojure test has 10 failures

2018-07-24 Thread Alex Miller
Mark, the Clojure build itself does not and has never used  
clojure-maven-plugin. Clojure just inherits Java defaults for the default 
encoding.

On the elided stack traces, the JVM is allowed to do this unless you pass a 
flag telling it not to.

What kind of JDK is this? I’ve seen some weird stuff in the past with the IBM 
JDK, but we have Oracle and OpenJDK for 8, 9, 10, and 11 in the test matrix (11 
has some different known issues).

-- 
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: clojure test has 10 failures

2018-07-24 Thread Peter Hull
On Tuesday, 24 July 2018 05:53:03 UTC+1, 冯忠孝 wrote:
>
>  [java] Ran 635 tests containing 17442 assertions.
>  [java] 10 failures, 0 errors.
>
> I see Throwable->map is involved in all of these; but I can't see how it 
could give the results it seems to here.
If you do
(Throwable->map (Exception. "text"))

at the REPL, what do you see?

-- 
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: clojure test has 10 failures

2018-07-24 Thread Mark Derricutt
On 25 Jul 2018, at 4:18, 冯忠孝 wrote:

> UTF-8

Is the build for this still using clojure-maven-plugin - it's possible I don't 
propagate this field down into anything that would be used by clojure when 
reading the CLJ files.

Does clojure have a property one can set to control the reader encoding?

---
"The ease with which a change can be implemented has no relevance at all to 
whether it is the right change for the (Java) Platform for all time." — 
Mark Reinhold.

Mark Derricutt
http://www.theoryinpractice.net
http://www.chaliceofblood.net
http://plus.google.com/+MarkDerricutt
http://twitter.com/talios
http://facebook.com/mderricutt

-- 
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: OpenPGP digital signature


Re: What Happened to "java -jar clojure.jar hosehead.clj" ?

2018-07-24 Thread Alex Miller
We have begun the process of breaking Clojure into more fine-grained modules. 
There is no timeline for this work but we expect this to become more common in 
the future so we have no plans to change this aspect of packaging.

The major benefit is that the modules can be released independently and at a 
faster rate than core itself. For example, newer versions of spec and the core 
specs libs have already been released and can be used now with Clojure 1.9. The 
new clj tool and its tool.deps lib exist to help you put these pieces together.



-- 
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: clojure test has 10 failures

2018-07-24 Thread Andy Fingerhut
Just another data point.

I tried Windows 10 Enterprise, Oracle JDK 1.8.0_171, Maven 3.5.0,
unmodified latest Clojure source code 1.10.0-alpha6.

mvn clean test

gave no errors.  The language/system/internationalization settings were US
English, but I have no idea if that could be making a difference.  The
errors you have during your tests do not seem related to language.

Andy

On Tue, Jul 24, 2018 at 9:18 AM 冯忠孝  wrote:

> 
> true
> UTF-8
> 
>
>
> after add propertis utf 8 to pom.xml , Still the same.
>
> --
> 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 Happened to "java -jar clojure.jar hosehead.clj" ?

2018-07-24 Thread Payter Versteegen
Alex,
Thanks for the links.
Digging into the release notes for 1.9.0, I see that:

Note that spec is in alpha state and API compatibility is not guaranteed. 
Also, spec and the specs for the Clojure core API are distributed as 
external libraries that *must be included to use Clojure*.

Emphasis mine as a complaint about the incompleteness of what's at the 
maven repo (linked from clojure.org).

Can the calls to the not-included spec bindings be removed (or checked 
around) in future releases?

Cheers,
Payter.
 
On Tuesday, July 24, 2018 at 11:58:12 AM UTC-4, Alex Miller wrote:

> Hey Payter,
>
> As of Clojure 1.9, parts of Clojure have been pulled out into other repos. 
> The readme has instructions at the top for building a combined local jar 
> from the git repo:
>
> https://github.com/clojure/clojure/blob/master/readme.txt
>
> Or you can use the new Clojure runner clj described at:
>
> https://clojure.org/guides/getting_started
>
> Alex
>
>

-- 
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: clojure test has 10 failures

2018-07-24 Thread 冯忠孝



true
UTF-8



after add propertis utf 8 to pom.xml , Still the same.

-- 
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 Happened to "java -jar clojure.jar hosehead.clj" ?

2018-07-24 Thread Alex Miller
Hey Payter,

As of Clojure 1.9, parts of Clojure have been pulled out into other repos. The 
readme has instructions at the top for building a combined local jar from the 
git repo:

https://github.com/clojure/clojure/blob/master/readme.txt

Or you can use the new Clojure runner clj described at:

https://clojure.org/guides/getting_started

Alex

-- 
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: clojure test has 10 failures

2018-07-24 Thread Alex Miller
If you want to file a ticket in jira I’m happy to look at making the tests more 
environment-independent (but I think that’s all this is).

-- 
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 Happened to "java -jar clojure.jar hosehead.clj" ?

2018-07-24 Thread Payter Versteegen
Trying to re-acquaint myself with clojure since 1.6.0. Given *hosehead.clj* 
as

(println (+ 1 2 3))

I used to be able to run:

% java -jar clojure-1.6.0.jar hosehead.clj
6

But with *clojure-1.9.0.jar* I'm treated to a *FileNotFoundException* 
looking for *clojure/spec/alpha.clj* in the classpath. I'd only downloaded 
files from the https://repo1.maven.org/maven2/org/clojure/clojure/1.9.0/ 
because 
I'd remember that's all I needed for 1.6.0. Plus, that's what my (old) copy 
of *Practical Clojure* had as an example.

I'm mostly disconnected from the internet, so it's difficult to chase down 
dependencies online in real time.

Is there a way to run 1.9.0 the same super-trivial way that I'd done with 
1.6.0?

Cheers,
Payter.

-- 
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: clojure test has 10 failures

2018-07-24 Thread Alex Miller
Some of them look like stack traces were omitted by the jvm resulting in nil 
traces. Some of the string stuff might be encoding issues?

-- 
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: clojure test has 10 failures

2018-07-24 Thread 冯忠孝

win10  china(中国)
jdk 1.8 
mvn test

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