Re: [ANN] Clojure 1.7.0-beta2

2015-05-02 Thread Brandon Bloom
Upgrading a couple of projects to 1.7 seems to have gone quite smoothly. 
Thanks!

However, I've encountered some problems with new features, like .cljc files.
Please see https://groups.google.com/forum/#!topic/clojure/TrYkq1lUuZw 

Cheers,
Brandon

On Friday, April 24, 2015 at 11:27:34 AM UTC-7, Alex Miller wrote:

 Clojure 1.7.0-beta2 is now available.

 Try it via
 - Download: 
 https://repo1.maven.org/maven2/org/clojure/clojure/1.7.0-beta2/
 - Leiningen: [org.clojure/clojure 1.7.0-beta2]

 Regression fixes since 1.7.0-beta1:

 1) CLJ-1711 - structmap iterator broken
 2) CLJ-1709 - range wrong for step != 1
 3) CLJ-1713 - range chunks are not serializable
 4) CLJ-1698 - fix reader conditional bugs

 Additional enhancements to new features since 1.7.0-beta1:

 1) CLJ-1703 - Pretty print #error and new public function Throwable-map
 2) CLJ-1700 - Reader conditionals now allowed in the REPL
 3) CLJ-1699 - Allow data_readers.cljc as well as data_readers.clj
   
 For a full list of changes since 1.6.0, see:
 https://github.com/clojure/clojure/blob/master/changes.md

 Please give it a try and let us know if things are working (or not)!

 - 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: [ANN] Clojure 1.7.0-beta2

2015-05-01 Thread Andy Fingerhut
I am not sure why you say new primitive type hints.  Primitive type hints
have been around for several Clojure released versions, 1.6.0 and earlier.

The error you are seeing is because of a property of the Clojure compiler
that as far as I know is not documented.  I asked back in Nov 2014 whether
it was, but didn't get any response [1].

Clojure eval's type tags on def'd names, and since 'long', 'longs', 'int',
'ints', etc. are also the names of functions in clojure.core, type tags of
the kind you tried to use, _when applied to the def'd or defn'd symbols_,
are treated as the values of those functions, and in most cases are ignored
by the Clojure compiler.  You found a case where they are not ignored.
This is not new in Clojure 1.7.0-beta2.  I verified your example gives the
same results with Clojure 1.6.0, and I would guess it would also do that
for a few earlier Clojure releases, too.

Either do this:

(defn ^{:tag 'longs} init-state []  (long-array 1))

or put the type tag on the argument vector instead:

(defn init-state ^longs []  (long-array 1))

The latest release of the Eastwood lint tool [2] will warn about type tags
of the kind you used:

(defn ^longs init-state []  (long-array 1))

Andy


[1] https://groups.google.com/d/msg/clojure-dev/u3mcy7iiQ40/ZUP8nglwVDsJ
[2] https://github.com/jonase/eastwood

On Fri, May 1, 2015 at 11:13 AM, shlomivak...@gmail.com wrote:

 I tried playing around with the new primitive type hints and got the
 following weird behavior on [org.clojure/clojure 1.7.0-beta2]:

 (defn ^longs init-state []  (long-array 1))

 (defn ^long store-state [^longs c ^long a] (aset c 0 a))

 running the following line resulted in an exception:

 (let [x (init-state)]
   (store-state x 5))

 1. Caused by java.lang.VerifyError
(class: clojure_7/core$eval13270, method: invoke signature:
()Ljava/lang/Object;) Unable to pop operand off an empty stack

 Class.java:   -2
  java.lang.Class/getDeclaredConstructors0
 Class.java: 2671
  java.lang.Class/privateGetDeclaredConstructors
 Class.java: 3075  java.lang.Class/getConstructor0
 Class.java:  412  java.lang.Class/newInstance
  Compiler.java: 4843  clojure.lang.Compiler$ObjExpr/eval
  Compiler.java: 6791  clojure.lang.Compiler/eval
  Compiler.java: 7237  clojure.lang.Compiler/load
   REPL:1  reverse-index.main/eval13258
  Compiler.java: 6792  clojure.lang.Compiler/eval
  Compiler.java: 6755  clojure.lang.Compiler/eval
   core.clj: 3079  clojure.core/eval
   main.clj:  240  clojure.main/repl/read-eval-print/fn
   main.clj:  240  clojure.main/repl/read-eval-print
   main.clj:  258  clojure.main/repl/fn
   main.clj:  258  clojure.main/repl
RestFn.java: 1523  clojure.lang.RestFn/invoke
 interruptible_eval.clj:   58
  clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn
   AFn.java:  152  clojure.lang.AFn/applyToHelper
   AFn.java:  144  clojure.lang.AFn/applyTo
   core.clj:  628  clojure.core/apply
   core.clj: 1866  clojure.core/with-bindings*
RestFn.java:  425  clojure.lang.RestFn/invoke
 interruptible_eval.clj:   56
  clojure.tools.nrepl.middleware.interruptible-eval/evaluate
 interruptible_eval.clj:  188
  clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
 interruptible_eval.clj:  157
  clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn
   AFn.java:   22  clojure.lang.AFn/run
ThreadPoolExecutor.java: 1142
  java.util.concurrent.ThreadPoolExecutor/runWorker
ThreadPoolExecutor.java:  617
  java.util.concurrent.ThreadPoolExecutor$Worker/run
Thread.java:  745  java.lang.Thread/run

 while the following line worked just fine:

 (store-state (init-state) 5)

 and also this works fine:

 (def a (init-state))
 (store-state a 5)

 (aget a 0) ;; 5

 What do you think?

 On Friday, April 24, 2015 at 11:27:40 AM UTC-7, Alex Miller wrote:

 Clojure 1.7.0-beta2 is now available.

 Try it via
 - Download:
 https://repo1.maven.org/maven2/org/clojure/clojure/1.7.0-beta2/
 - Leiningen: [org.clojure/clojure 1.7.0-beta2]

 Regression fixes since 1.7.0-beta1:

 1) CLJ-1711 - structmap iterator broken
 2) CLJ-1709 - range wrong for step != 1
 3) CLJ-1713 - range chunks are not serializable
 4) CLJ-1698 - fix reader conditional bugs

 Additional enhancements to new features since 1.7.0-beta1:

 1) CLJ-1703 - Pretty print #error and new public function Throwable-map
 2) CLJ-1700 - Reader conditionals now allowed in the REPL
 3) CLJ-1699 - Allow data_readers.cljc as well as data_readers.clj

 For a full list of changes since 

Re: [ANN] Clojure 1.7.0-beta2

2015-05-01 Thread Nicola Mometto

Fluid Dynamics writes:

 That's weirdly inconsistent with e.g. (defn ^String prefix [s n]...).

It can be surprising behaviour, but it's not an inconsistency.
As per the documentation, metadata on the symbol being def'd *is*
evaluated, metadata on the argvec isn't.
Evaluating `String` produces the java.lang.String Class -- a valid tag,
evaluating `longs` produces the clojure.core/longs function -- not a
valid tag. OTOH 'longs is a valid tag that the compiler understands.

 It also doesn't negate the original bug report. That VerifyError means that
 the Clojure compiler emitted invalid bytecode, instead of either emitting
 valid bytecode or reporting a sensible error. Any way you slice it the
 compiler is buggy if it can quietly emit broken bytecode.

The reported exception is not all of what happens.
If you try to execute that code you'll see that you get two exceptions,
the first one being java.lang.IllegalArgumentException: Unable to
resolve classname: clojure.core$longs@3f91beef which tells you exactly
what I told you before -- clojure.core/long is not a valid type hint.

The VerifyError is thrown later and is caused by the fact that the
compiler emits partial bytecode as it gets interrupted by the
IllegalArgumentException.

Now, if you want to argue that the compiler should immediately throw an
error as soon as the wrong type hint is used rather than silently ignore
it and fail when the type-hinted form is used, I'll agree with you and
I've proposed to make the compiler stricter a number of times on the
clojure-dev ML and talked about it on IRC but I guess either it's not a
priority for the clojure/core team or they're simply not interested in
more compile-time checks.
Either way the reported issue was a user error, not a compiler bug.

--

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

2015-05-01 Thread Nicola Mometto

Alex Miller writes:

 On Fri, May 1, 2015 at 2:53 PM, Nicola Mometto brobro...@gmail.com wrote:


 Now, if you want to argue that the compiler should immediately throw an
 error as soon as the wrong type hint is used rather than silently ignore
 it and fail when the type-hinted form is used, I'll agree with you and
 I've proposed to make the compiler stricter a number of times on the
 clojure-dev ML and talked about it on IRC but I guess either it's not a
 priority for the clojure/core team or they're simply not interested in
 more compile-time checks.


 Is there a ticket?

There are a number of tickets reporting errors caused by the compiler
silently ignoring invalid type hints
http://dev.clojure.org/jira/browse/CLJ-1674
http://dev.clojure.org/jira/browse/CLJ-1232

or type hints inconsistencies
http://dev.clojure.org/jira/browse/CLJ-1577
http://dev.clojure.org/jira/browse/CLJ-1533

There are no open tickets open that I'm aware of about making the
compiler stricter on :tag values.

I would open one but there's this clojure-dev thread
https://groups.google.com/forum/#!msg/clojure-dev/hRZFuaiB_50/mzKLirgZWmUJ
where I ask what should be the allowed :tag values and I got no
clarification on it -- I see no point in spending my time working on a
patch/enhancement proposal that would break contrib libraries used by
clojure itself (there's no way to make the compiler throw on e.g. (defn
^doubles foo ..) and not throw on test.generative usages) until I know
for a fact that I would not be wasting my time

--

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

2015-05-01 Thread Alex Miller
On Fri, May 1, 2015 at 2:53 PM, Nicola Mometto brobro...@gmail.com wrote:


 Now, if you want to argue that the compiler should immediately throw an
 error as soon as the wrong type hint is used rather than silently ignore
 it and fail when the type-hinted form is used, I'll agree with you and
 I've proposed to make the compiler stricter a number of times on the
 clojure-dev ML and talked about it on IRC but I guess either it's not a
 priority for the clojure/core team or they're simply not interested in
 more compile-time checks.


Is there a ticket?

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

2015-05-01 Thread Fluid Dynamics
On Friday, May 1, 2015 at 3:54:08 PM UTC-4, Nicola Mometto wrote:


 Fluid Dynamics writes: 

  That's weirdly inconsistent with e.g. (defn ^String prefix [s n]...). 

 It can be surprising behaviour, but it's not an inconsistency. 
 As per the documentation, metadata on the symbol being def'd *is* 
 evaluated, metadata on the argvec isn't. 
 Evaluating `String` produces the java.lang.String Class -- a valid tag, 
 evaluating `longs` produces the clojure.core/longs function -- not a 
 valid tag. OTOH 'longs is a valid tag that the compiler understands. 

  It also doesn't negate the original bug report. That VerifyError means 
 that 
  the Clojure compiler emitted invalid bytecode, instead of either 
 emitting 
  valid bytecode or reporting a sensible error. Any way you slice it the 
  compiler is buggy if it can quietly emit broken bytecode. 

 The reported exception is not all of what happens. 
 If you try to execute that code you'll see that you get two exceptions, 
 the first one being java.lang.IllegalArgumentException: Unable to 
 resolve classname: clojure.core$longs@3f91beef which tells you exactly 
 what I told you before -- clojure.core/long is not a valid type hint. 

 The VerifyError is thrown later and is caused by the fact that the 
 compiler emits partial bytecode as it gets interrupted by the 
 IllegalArgumentException. 

 Now, if you want to argue that the compiler should immediately throw an 
 error as soon as the wrong type hint is used rather than silently ignore 
 it and fail when the type-hinted form is used, I'll agree with you and 
 I've proposed to make the compiler stricter a number of times on the 
 clojure-dev ML and talked about it on IRC but I guess either it's not a 
 priority for the clojure/core team or they're simply not interested in 
 more compile-time checks. 
 Either way the reported issue was a user error, not a compiler bug. 


Seems to me it's both. Certainly if the compiler were bug-free there would 
never be a VerifyError while running clojure, other than maybe when 
dynamically loading a buggy class that originated somewhere else. (e.g. 
(eval '(.some.pkg.BuggyClass 42 606)) with a broken 
some/pkg/BuggyClass.class in the classpath.)
 

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

2015-05-01 Thread shlomivaknin
I tried playing around with the new primitive type hints and got the 
following weird behavior on [org.clojure/clojure 1.7.0-beta2]:

(defn ^longs init-state []  (long-array 1))

(defn ^long store-state [^longs c ^long a] (aset c 0 a))

running the following line resulted in an exception:

(let [x (init-state)]
  (store-state x 5))

1. Caused by java.lang.VerifyError
   (class: clojure_7/core$eval13270, method: invoke signature:
   ()Ljava/lang/Object;) Unable to pop operand off an empty stack

Class.java:   -2 
 java.lang.Class/getDeclaredConstructors0
Class.java: 2671 
 java.lang.Class/privateGetDeclaredConstructors
Class.java: 3075  java.lang.Class/getConstructor0
Class.java:  412  java.lang.Class/newInstance
 Compiler.java: 4843  clojure.lang.Compiler$ObjExpr/eval
 Compiler.java: 6791  clojure.lang.Compiler/eval
 Compiler.java: 7237  clojure.lang.Compiler/load
  REPL:1  reverse-index.main/eval13258
 Compiler.java: 6792  clojure.lang.Compiler/eval
 Compiler.java: 6755  clojure.lang.Compiler/eval
  core.clj: 3079  clojure.core/eval
  main.clj:  240  clojure.main/repl/read-eval-print/fn
  main.clj:  240  clojure.main/repl/read-eval-print
  main.clj:  258  clojure.main/repl/fn
  main.clj:  258  clojure.main/repl
   RestFn.java: 1523  clojure.lang.RestFn/invoke
interruptible_eval.clj:   58 
 clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn
  AFn.java:  152  clojure.lang.AFn/applyToHelper
  AFn.java:  144  clojure.lang.AFn/applyTo
  core.clj:  628  clojure.core/apply
  core.clj: 1866  clojure.core/with-bindings*
   RestFn.java:  425  clojure.lang.RestFn/invoke
interruptible_eval.clj:   56 
 clojure.tools.nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj:  188 
 clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
interruptible_eval.clj:  157 
 clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn
  AFn.java:   22  clojure.lang.AFn/run
   ThreadPoolExecutor.java: 1142 
 java.util.concurrent.ThreadPoolExecutor/runWorker
   ThreadPoolExecutor.java:  617 
 java.util.concurrent.ThreadPoolExecutor$Worker/run
   Thread.java:  745  java.lang.Thread/run

while the following line worked just fine:

(store-state (init-state) 5)

and also this works fine:

(def a (init-state))
(store-state a 5)

(aget a 0) ;; 5

What do you think?

On Friday, April 24, 2015 at 11:27:40 AM UTC-7, Alex Miller wrote:

 Clojure 1.7.0-beta2 is now available.

 Try it via
 - Download: 
 https://repo1.maven.org/maven2/org/clojure/clojure/1.7.0-beta2/
 - Leiningen: [org.clojure/clojure 1.7.0-beta2]

 Regression fixes since 1.7.0-beta1:

 1) CLJ-1711 - structmap iterator broken
 2) CLJ-1709 - range wrong for step != 1
 3) CLJ-1713 - range chunks are not serializable
 4) CLJ-1698 - fix reader conditional bugs

 Additional enhancements to new features since 1.7.0-beta1:

 1) CLJ-1703 - Pretty print #error and new public function Throwable-map
 2) CLJ-1700 - Reader conditionals now allowed in the REPL
 3) CLJ-1699 - Allow data_readers.cljc as well as data_readers.clj
   
 For a full list of changes since 1.6.0, see:
 https://github.com/clojure/clojure/blob/master/changes.md

 Please give it a try and let us know if things are working (or not)!

 - 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: [ANN] Clojure 1.7.0-beta2

2015-05-01 Thread shlomivaknin
Right you are, silly me :)

thanks!

On Friday, May 1, 2015 at 11:17:42 AM UTC-7, Nicola Mometto wrote:


 The type-hint on init-state is wrong. 

 It has to be either 

 (defn {:tag 'longs} init-state [] (long-array 1)) 
 or (preferred) 
 (defn init-state ^longs [] (long-array 1)) 


 shlomi...@gmail.com javascript: writes: 

  I tried playing around with the new primitive type hints and got the 
  following weird behavior on [org.clojure/clojure 1.7.0-beta2]: 
  
  (defn ^longs init-state []  (long-array 1)) 
  
  (defn ^long store-state [^longs c ^long a] (aset c 0 a)) 
  
  running the following line resulted in an exception: 
  
  (let [x (init-state)] 
(store-state x 5)) 
  
  1. Caused by java.lang.VerifyError 
 (class: clojure_7/core$eval13270, method: invoke signature: 
 ()Ljava/lang/Object;) Unable to pop operand off an empty stack 
  
  Class.java:   -2 
   java.lang.Class/getDeclaredConstructors0 
  Class.java: 2671 
   java.lang.Class/privateGetDeclaredConstructors 
  Class.java: 3075  java.lang.Class/getConstructor0 
  Class.java:  412  java.lang.Class/newInstance 
   Compiler.java: 4843  clojure.lang.Compiler$ObjExpr/eval 
   Compiler.java: 6791  clojure.lang.Compiler/eval 
   Compiler.java: 7237  clojure.lang.Compiler/load 
REPL:1  reverse-index.main/eval13258 
   Compiler.java: 6792  clojure.lang.Compiler/eval 
   Compiler.java: 6755  clojure.lang.Compiler/eval 
core.clj: 3079  clojure.core/eval 
main.clj:  240 
  clojure.main/repl/read-eval-print/fn 
main.clj:  240  clojure.main/repl/read-eval-print 
main.clj:  258  clojure.main/repl/fn 
main.clj:  258  clojure.main/repl 
 RestFn.java: 1523  clojure.lang.RestFn/invoke 
  interruptible_eval.clj:   58 
   clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn 
AFn.java:  152  clojure.lang.AFn/applyToHelper 
AFn.java:  144  clojure.lang.AFn/applyTo 
core.clj:  628  clojure.core/apply 
core.clj: 1866  clojure.core/with-bindings* 
 RestFn.java:  425  clojure.lang.RestFn/invoke 
  interruptible_eval.clj:   56 
   clojure.tools.nrepl.middleware.interruptible-eval/evaluate 
  interruptible_eval.clj:  188 
  
  clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn 
  interruptible_eval.clj:  157 
   clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn 
AFn.java:   22  clojure.lang.AFn/run 
 ThreadPoolExecutor.java: 1142 
   java.util.concurrent.ThreadPoolExecutor/runWorker 
 ThreadPoolExecutor.java:  617 
   java.util.concurrent.ThreadPoolExecutor$Worker/run 
 Thread.java:  745  java.lang.Thread/run 
  
  while the following line worked just fine: 
  
  (store-state (init-state) 5) 
  
  and also this works fine: 
  
  (def a (init-state)) 
  (store-state a 5) 
  
  (aget a 0) ;; 5 
  
  What do you think? 
  
  On Friday, April 24, 2015 at 11:27:40 AM UTC-7, Alex Miller wrote: 
  
  Clojure 1.7.0-beta2 is now available. 
  
  Try it via 
  - Download: 
  https://repo1.maven.org/maven2/org/clojure/clojure/1.7.0-beta2/ 
  - Leiningen: [org.clojure/clojure 1.7.0-beta2] 
  
  Regression fixes since 1.7.0-beta1: 
  
  1) CLJ-1711 - structmap iterator broken 
  2) CLJ-1709 - range wrong for step != 1 
  3) CLJ-1713 - range chunks are not serializable 
  4) CLJ-1698 - fix reader conditional bugs 
  
  Additional enhancements to new features since 1.7.0-beta1: 
  
  1) CLJ-1703 - Pretty print #error and new public function 
 Throwable-map 
  2) CLJ-1700 - Reader conditionals now allowed in the REPL 
  3) CLJ-1699 - Allow data_readers.cljc as well as data_readers.clj 
  
  For a full list of changes since 1.6.0, see: 
  https://github.com/clojure/clojure/blob/master/changes.md 
  
  Please give it a try and let us know if things are working (or not)! 
  
  - 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: [ANN] Clojure 1.7.0-beta2

2015-05-01 Thread Nicola Mometto

The type-hint on init-state is wrong.

It has to be either

(defn {:tag 'longs} init-state [] (long-array 1))
or (preferred)
(defn init-state ^longs [] (long-array 1))


shlomivak...@gmail.com writes:

 I tried playing around with the new primitive type hints and got the
 following weird behavior on [org.clojure/clojure 1.7.0-beta2]:

 (defn ^longs init-state []  (long-array 1))

 (defn ^long store-state [^longs c ^long a] (aset c 0 a))

 running the following line resulted in an exception:

 (let [x (init-state)]
   (store-state x 5))

 1. Caused by java.lang.VerifyError
(class: clojure_7/core$eval13270, method: invoke signature:
()Ljava/lang/Object;) Unable to pop operand off an empty stack

 Class.java:   -2
  java.lang.Class/getDeclaredConstructors0
 Class.java: 2671
  java.lang.Class/privateGetDeclaredConstructors
 Class.java: 3075  java.lang.Class/getConstructor0
 Class.java:  412  java.lang.Class/newInstance
  Compiler.java: 4843  clojure.lang.Compiler$ObjExpr/eval
  Compiler.java: 6791  clojure.lang.Compiler/eval
  Compiler.java: 7237  clojure.lang.Compiler/load
   REPL:1  reverse-index.main/eval13258
  Compiler.java: 6792  clojure.lang.Compiler/eval
  Compiler.java: 6755  clojure.lang.Compiler/eval
   core.clj: 3079  clojure.core/eval
   main.clj:  240  clojure.main/repl/read-eval-print/fn
   main.clj:  240  clojure.main/repl/read-eval-print
   main.clj:  258  clojure.main/repl/fn
   main.clj:  258  clojure.main/repl
RestFn.java: 1523  clojure.lang.RestFn/invoke
 interruptible_eval.clj:   58
  clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn
   AFn.java:  152  clojure.lang.AFn/applyToHelper
   AFn.java:  144  clojure.lang.AFn/applyTo
   core.clj:  628  clojure.core/apply
   core.clj: 1866  clojure.core/with-bindings*
RestFn.java:  425  clojure.lang.RestFn/invoke
 interruptible_eval.clj:   56
  clojure.tools.nrepl.middleware.interruptible-eval/evaluate
 interruptible_eval.clj:  188
  clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
 interruptible_eval.clj:  157
  clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn
   AFn.java:   22  clojure.lang.AFn/run
ThreadPoolExecutor.java: 1142
  java.util.concurrent.ThreadPoolExecutor/runWorker
ThreadPoolExecutor.java:  617
  java.util.concurrent.ThreadPoolExecutor$Worker/run
Thread.java:  745  java.lang.Thread/run

 while the following line worked just fine:

 (store-state (init-state) 5)

 and also this works fine:

 (def a (init-state))
 (store-state a 5)

 (aget a 0) ;; 5

 What do you think?

 On Friday, April 24, 2015 at 11:27:40 AM UTC-7, Alex Miller wrote:

 Clojure 1.7.0-beta2 is now available.

 Try it via
 - Download:
 https://repo1.maven.org/maven2/org/clojure/clojure/1.7.0-beta2/
 - Leiningen: [org.clojure/clojure 1.7.0-beta2]

 Regression fixes since 1.7.0-beta1:

 1) CLJ-1711 - structmap iterator broken
 2) CLJ-1709 - range wrong for step != 1
 3) CLJ-1713 - range chunks are not serializable
 4) CLJ-1698 - fix reader conditional bugs

 Additional enhancements to new features since 1.7.0-beta1:

 1) CLJ-1703 - Pretty print #error and new public function Throwable-map
 2) CLJ-1700 - Reader conditionals now allowed in the REPL
 3) CLJ-1699 - Allow data_readers.cljc as well as data_readers.clj

 For a full list of changes since 1.6.0, see:
 https://github.com/clojure/clojure/blob/master/changes.md

 Please give it a try and let us know if things are working (or not)!

 - 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: [ANN] Clojure 1.7.0-beta2

2015-05-01 Thread Fluid Dynamics
On Friday, May 1, 2015 at 2:17:42 PM UTC-4, Nicola Mometto wrote:


 The type-hint on init-state is wrong. 

 It has to be either 

 (defn {:tag 'longs} init-state [] (long-array 1)) 
 or (preferred) 
 (defn init-state ^longs [] (long-array 1)) 


That's weirdly inconsistent with e.g. (defn ^String prefix [s n]...).

It also doesn't negate the original bug report. That VerifyError means that 
the Clojure compiler emitted invalid bytecode, instead of either emitting 
valid bytecode or reporting a sensible error. Any way you slice it the 
compiler is buggy if it can quietly emit broken bytecode.

-- 
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] Clojure 1.7.0-beta2

2015-04-24 Thread Alex Miller
Clojure 1.7.0-beta2 is now available.

Try it via
- Download: https://repo1.maven.org/maven2/org/clojure/clojure/1.7.0-beta2/
- Leiningen: [org.clojure/clojure 1.7.0-beta2]

Regression fixes since 1.7.0-beta1:

1) CLJ-1711 - structmap iterator broken
2) CLJ-1709 - range wrong for step != 1
3) CLJ-1713 - range chunks are not serializable
4) CLJ-1698 - fix reader conditional bugs

Additional enhancements to new features since 1.7.0-beta1:

1) CLJ-1703 - Pretty print #error and new public function Throwable-map
2) CLJ-1700 - Reader conditionals now allowed in the REPL
3) CLJ-1699 - Allow data_readers.cljc as well as data_readers.clj

For a full list of changes since 1.6.0, see:
https://github.com/clojure/clojure/blob/master/changes.md

Please give it a try and let us know if things are working (or not)!

- 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: [ANN] Clojure 1.7.0-beta2

2015-04-24 Thread Matt Mitchell
Awesome. Just tested it on our API and working well. Looking forward to a 
more in depth testing session!

- Matt

On Friday, April 24, 2015 at 2:27:40 PM UTC-4, Alex Miller wrote:

 Clojure 1.7.0-beta2 is now available.

 Try it via
 - Download: 
 https://repo1.maven.org/maven2/org/clojure/clojure/1.7.0-beta2/
 - Leiningen: [org.clojure/clojure 1.7.0-beta2]

 Regression fixes since 1.7.0-beta1:

 1) CLJ-1711 - structmap iterator broken
 2) CLJ-1709 - range wrong for step != 1
 3) CLJ-1713 - range chunks are not serializable
 4) CLJ-1698 - fix reader conditional bugs

 Additional enhancements to new features since 1.7.0-beta1:

 1) CLJ-1703 - Pretty print #error and new public function Throwable-map
 2) CLJ-1700 - Reader conditionals now allowed in the REPL
 3) CLJ-1699 - Allow data_readers.cljc as well as data_readers.clj
   
 For a full list of changes since 1.6.0, see:
 https://github.com/clojure/clojure/blob/master/changes.md

 Please give it a try and let us know if things are working (or not)!

 - 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: [ANN] Clojure 1.7.0-beta2

2015-04-24 Thread Alex Miller
Thanks David! 

Instaparse was using some internals of the reader, which changed for reader 
conditionals, but has subsequently been patched.

On Friday, April 24, 2015 at 2:06:01 PM UTC-5, David McNeil wrote:

 I did a real quick test on one of our projects. I had to upgrade to the 
 latest compojure (seems the old version used a version of instaparse that 
 wouldn't compile) but after that it seemed to work and was noticably faster.

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

2015-04-24 Thread David McNeil
I did a real quick test on one of our projects. I had to upgrade to the 
latest compojure (seems the old version used a version of instaparse that 
wouldn't compile) but after that it seemed to work and was noticably faster.

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