Clojure 1.2 Beta 1

53 views
Skip to first unread message

Stuart Halloway

unread,
Jul 14, 2010, 11:03:55 AM7/14/10
to clo...@googlegroups.com
Clojure 1.2 Beta 1 is now available, along with a corresponding Clojure Contrib, at:

http://clojure.org/downloads

It contains significant new features, as well as many bug fixes and small enhancements. A larger number of contributors than ever before have pitched in. You can see an overview of the changes in the changes file at:

http://github.com/clojure/clojure/blob/1.2.x/changes.txt

For maven/leiningen users, your settings to get the beta from build.clojure.org/releases are:

:dependencies [[org.clojure/clojure "1.2.0-beta1"]
[org.clojure/clojure-contrib "1.2.0-beta1"]

To everyone who has contributed to 1.2, many thanks!

Stu

Sean Devlin

unread,
Jul 14, 2010, 11:16:15 AM7/14/10
to Clojure
Congrats!

On Jul 14, 11:03 am, Stuart Halloway <stuart.hallo...@gmail.com>
wrote:

David Nolen

unread,
Jul 14, 2010, 11:23:54 AM7/14/10
to clo...@googlegroups.com
Congrats! It's an incredible update.

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

Frederick Polgardy

unread,
Jul 14, 2010, 11:24:33 AM7/14/10
to Clojure
Awesome! Looks great.

What branch/tag of clojure-contrib is the clojure-contrib-1.2.0-
beta1.zip download built from? I don't see it under branches, and
master builds clojure-contrib-1.2.0-SNAPSHOT.jar.

Thanks.

On Jul 14, 10:03 am, Stuart Halloway <stuart.hallo...@gmail.com>
wrote:

Stuart Halloway

unread,
Jul 14, 2010, 11:35:07 AM7/14/10
to clo...@googlegroups.com
Just pushed, sorry.

Peter Schuller

unread,
Jul 14, 2010, 11:25:29 AM7/14/10
to clo...@googlegroups.com
Hugely appreciated!

--
/ Peter Schuller

ngocdaothanh

unread,
Jul 14, 2010, 11:54:36 AM7/14/10
to Clojure
Report:
There is still "call to contains can't be resolved" for defrecord.
After googling for this message, I see that it has been discussed (and
can be easily fixed?).

MarkSwanson

unread,
Jul 14, 2010, 1:33:05 PM7/14/10
to Clojure
I didn't see mention of the new equals/equiv work.
Is this going into a later beta or is this work tentatively going into
a later release?

Stuart Halloway

unread,
Jul 14, 2010, 1:42:22 PM7/14/10
to clo...@googlegroups.com
Later release.

> I didn't see mention of the new equals/equiv work.
> Is this going into a later beta or is this work tentatively going into
> a later release?
>

Stuart Halloway

unread,
Jul 14, 2010, 1:53:04 PM7/14/10
to clo...@googlegroups.com

Praki Prakash

unread,
Jul 14, 2010, 2:14:00 PM7/14/10
to clo...@googlegroups.com
I think my number crunching code would benefit immensely from
equals/equiv code. When can we hope to see a release containing
equals/equiv effort?

Thanks

Stuart Halloway

unread,
Jul 14, 2010, 2:21:01 PM7/14/10
to clo...@googlegroups.com
It will probably go on master fairly soon, but the community will need some time with it before a release.

Todd

unread,
Jul 15, 2010, 1:41:55 AM7/15/10
to clo...@googlegroups.com
I'm having difficulty getting leiningen to work w/ clojure 1.2...

REPRO:

0. install leiningen and then upgrade it

lein upgrade

The script at ./lein will be upgraded to the latest stable version.
Do you want to continue [Y/n]? y

Upgrading...
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 4061 100 4061 0 0 10731 0 --:--:-- --:--:-- --:--:--
17504

Downloading Leiningen now...
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 8076k 100 8076k 0 0 1093k 0 0:00:07 0:00:07 --:--:--
1271k

Now running Leiningen 1.1.0 on Java 1.6.0_20 Java HotSpot(TM) 64-Bit
Server VM


1. create a new app
lein new test02

1.a verify

cat project.clj

(defproject test02 "1.0.0-SNAPSHOT"
:description "FIXME: write"
:dependencies [[org.clojure/clojure "1.1.0"]
[org.clojure/clojure-contrib "1.1.0"]])


2. make sure lein works there
cd test02
lein help

3. ok, targets listed, now upgrade to clojure 1.2 beta 1
cat project.clj

(defproject test02 "1.0.0-SNAPSHOT"
:description "FIXME: write"
:dependencies [[org.clojure/clojure "1.2.0-master-SNAPSHOT"]
[org.clojure/clojure-contrib "1.2.0-SNAPSHOT"]])

lein deps
[copy] Copying 2 files to
/Users/todd/Documents/projects/clojure/lein-test/test02/lib

4. now try running help again...

lein help

WARNING: reader macro ^ is deprecated; use meta instead
Exception in thread "main" java.lang.RuntimeException:
java.lang.ClassCastException: clojure.lang.Cons cannot be cast to
clojure.lang.Named (help.clj:5)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:2780)
at clojure.lang.Compiler$DefExpr.eval(Compiler.java:302)
at clojure.lang.Compiler.eval(Compiler.java:4647)
at clojure.lang.Compiler.load(Compiler.java:4972)
at clojure.lang.RT.loadResourceScript(RT.java:330)
at clojure.lang.RT.loadResourceScript(RT.java:321)
at clojure.lang.RT.load(RT.java:399)
at clojure.lang.RT.load(RT.java:371)
at clojure.core$load__6449$fn__6458.invoke(core.clj:4171)
at clojure.core$load__6449.doInvoke(core.clj:4170)
at clojure.lang.RestFn.invoke(RestFn.java:413)
at clojure.core$load_one__6379.invoke(core.clj:4007)
at clojure.core$load_lib__6400.doInvoke(core.clj:4044)
at clojure.lang.RestFn.applyTo(RestFn.java:147)
at clojure.core$apply__4370.invoke(core.clj:438)
at clojure.core$load_libs__6417.doInvoke(core.clj:4070)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply__4370.invoke(core.clj:438)
at clojure.core$require__6440.doInvoke(core.clj:4138)
at clojure.lang.RestFn.invoke(RestFn.java:413)
at leiningen.core$resolve_task__38.invoke(core.clj:65)
at leiningen.core$_main__46$fn__49.invoke(core.clj:81)
at leiningen.core$_main__46.doInvoke(core.clj:78)
at clojure.lang.RestFn.invoke(RestFn.java:413)
at user$eval__55.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:4642)
at clojure.core$eval__5236.invoke(core.clj:2017)
at clojure.main$eval_opt__7411.invoke(main.clj:227)
at clojure.main$initialize__7418.invoke(main.clj:246)
at clojure.main$null_opt__7446.invoke(main.clj:271)
at clojure.main$main__7466.doInvoke(main.clj:346)
at clojure.lang.RestFn.invoke(RestFn.java:426)
at clojure.lang.Var.invoke(Var.java:363)
at clojure.lang.AFn.applyToHelper(AFn.java:175)
at clojure.lang.Var.applyTo(Var.java:476)
at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: java.lang.ClassCastException:
clojure.lang.Cons cannot be cast to clojure.lang.Named
at clojure.lang.LazySeq.sval(LazySeq.java:47)
at clojure.lang.LazySeq.seq(LazySeq.java:63)
at clojure.lang.Cons.next(Cons.java:37)
at clojure.lang.PersistentHashSet.create(PersistentHashSet.java:41)
at clojure.core$hash_set__4294.doInvoke(core.clj:285)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply__4370.invoke(core.clj:436)
at clojure.core$set__5556.invoke(core.clj:2636)
at clojure.lang.AFn.applyToHelper(AFn.java:173)
at clojure.lang.AFn.applyTo(AFn.java:164)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:2775)
... 35 more
Caused by: java.lang.ClassCastException: clojure.lang.Cons cannot be
cast to clojure.lang.Named
at clojure.core$name__4748.invoke(core.clj:1053)
at leiningen.help$fn__67.invoke(help.clj:5)
at clojure.core$filter__5084$fn__5086.invoke(core.clj:1804)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
... 45 more

-Todd

Btsai

unread,
Jul 15, 2010, 2:56:29 AM7/15/10
to Clojure
Congrats to Clojure on hitting this fantastic milestone :)

Question: the release notes mentions a new clojure.string namespace.
But I've had no luck finding it in the online API at
http://richhickey.github.com/clojure/. Am I missing something?

Jeffrey Schwab

unread,
Jul 15, 2010, 9:11:57 AM7/15/10
to clo...@googlegroups.com
Is Clojure 1.2 Beta 1 built from the current clojure.git head on github?
I don't see any 1.2 branches or tags, and the repl prints the following:

Clojure 1.2.0-master-SNAPSHOT

I also don't see any commits since 6/23; is that right?

Thanks and congratulations, btw. :)

nickikt

unread,
Jul 15, 2010, 9:24:56 AM7/15/10
to Clojure
the new branch is called clojure not master

Meikel Brandmeyer

unread,
Jul 15, 2010, 9:42:51 AM7/15/10
to Clojure
Hi,

On Jul 15, 3:24 pm, nickikt <nick...@gmail.com> wrote:

> the new branch is called clojure not master

To be more precise: the new repo is under http://github.com/clojure

Sincerely
Meikel

Adrian Cuthbertson

unread,
Jul 15, 2010, 9:57:29 AM7/15/10
to clo...@googlegroups.com
I'm trying...
git clone http://github.com/clojure/clojure.git
and getting the following error...

Getting pack 9be7389ab68fea4a8309596c2916961599d2b06c
which contains 833f9f368d2274766aa4699195b3fba3f9e4e8f0
error: Unable to get pack file
http://github.com/clojure/clojure.git/objects/pack/pack-9be7389ab68fea4a8309596c2916961599d2b06c.pack
transfer closed with 2113048 bytes remaining to read
error: Unable to find 833f9f368d2274766aa4699195b3fba3f9e4e8f0 under
http://github.com/clojure/clojure.git
Cannot obtain needed object 833f9f368d2274766aa4699195b3fba3f9e4e8f0
while processing commit d184ed95817c5ddfd5874ea75e83e0df7e753c24.
fatal: Fetch failed.

Any ideas?

> --

Adrian Cuthbertson

unread,
Jul 15, 2010, 10:15:43 AM7/15/10
to clo...@googlegroups.com
Apparently there's a problem with git clone http://...

Should be git clone git://github.com/clojure/clojure.git

Sorry for the noise.

Phil Hagelberg

unread,
Jul 15, 2010, 11:48:40 AM7/15/10
to clo...@googlegroups.com
On Wed, Jul 14, 2010 at 10:41 PM, Todd <t.green...@gmail.com> wrote:
> I'm having difficulty getting leiningen to work w/ clojure 1.2...
>
> REPRO:
>
> 0. install leiningen and then upgrade it
>
> lein upgrade
>
> The script at ./lein will be upgraded to the latest stable version.
> Do you want to continue [Y/n]? y

Yes, it looks like Leiningen 1.1.0 has a bug where it prefers the
project's version of Clojure to its own version even for Leiningen's
JVM. This was fixed several months ago though, so if you use 1.2.0-RC2
you should be fine.

-Phil

Jeffrey Schwab

unread,
Jul 15, 2010, 1:00:21 PM7/15/10
to clo...@googlegroups.com
On 7/15/10 9:24 AM, nickikt wrote:
> the new branch is called clojure not master

Thanks, but I see no branch by that name. Do you mean 1.2.x? (And
what's the corresponding branch for clojure-contrib?)


Jeffrey Schwab

unread,
Jul 15, 2010, 1:02:36 PM7/15/10
to clo...@googlegroups.com
On 7/15/10 10:15 AM, Adrian Cuthbertson wrote:
> Apparently there's a problem with git clone http://...
>
> Should be git clone git://github.com/clojure/clojure.git
>
> Sorry for the noise.

Thanks, I've been mistakenly working from

git://github.com/richhickey/clojure.git


...which is apparently why I didn't see any commits since June.

nickikt

unread,
Jul 15, 2010, 7:19:10 PM7/15/10
to Clojure
Sorry my answer was so short. I only remember that there was some kind
of problem with master.git and clojure.git. So I thought I'll give you
a tip and you will figure out the rest but your problem was bigger
then I thought.

Stefan Kamphausen

unread,
Jul 16, 2010, 1:08:31 PM7/16/10
to Clojure
Hi,

I think I found a minor problem. It appears with the error handling
of agents and actually is just a minor glitch in the output.

Consider the following session, copied from a terminal:

shell> java -cp clojure.jar clojure.main
Clojure 1.2.0-beta1
user=> (def agt1 (agent "One"))
#'user/agt1
user=> (defn upd-agt1 [current new-val]
(if (= new-val "fail")
(throw (Exception. "Update failed."))
(str "Update: " new-val)))
#'user/upd-agt1
user=> (error-mode agt1)
:fail
user=> (send agt1 upd-agt1 "fail")
#<Agent@21ed5459 FAILED: "One">

It creates an agent and causes an error in the update function. The
error mode of the agent is :fail and it silently fails when calling
the action. The failed status is visible from the printed output of
the agent in the last line. Further attempts to update the agent will
raise an exception.

Now for a second version see the following session, which started
fresh. It does the same thing as the first session, but it makes sure
that the thread-pool for the agents contains more threads, first.

shell> java -cp clojure.jar clojure.main
Clojure 1.2.0-beta1
;; this just creates some threads in the pool
user=> (def agt2 (agent {:count 0}))
#'user/agt2
user=> (defn agt2-action [state]
(println "In Thread" (.getName (Thread/currentThread)))
(if (< (:count state) 5)
(do (send agt2 agt2-action)
(assoc state :count (inc (:count state))))
state))
#'user/agt2-action
user=> (send agt2 agt2-action)
In Thread pool-1-thread-1
#<Agent@4c6504bc: In Thread pool-1-thread-2
In Thread pool-1-thread-3
{:countIn Thread pool-1-thread-4
1}>
In Thread pool-1-thread-4
user=> In Thread pool-1-thread-4
;; now the same as before...
user=> (def agt1 (agent "One"))
#'user/agt1
user=> (defn upd-agt1 [current new-val]
(if (= new-val "fail")
(throw (Exception. "Update failed."))
(str "Update: " new-val)))
#'user/upd-agt1
user=> (error-mode agt1)
:fail
user=> (send agt1 upd-agt1 "fail")
#<Agent@7f11bfbc: "One">


This time the output doesn't show the FAILED status of the agent.

I am by no means sure that this change in behavior is related to the
pool of threads. I found it by accident and could reproduce it
several times.

Kind regards,
Stefan

Stuart Halloway

unread,
Jul 16, 2010, 1:54:10 PM7/16/10
to clo...@googlegroups.com
Hi Stefan,

The behavior you are seeing is not a problem, and understanding why may be helpful to using agents correctly.

The thread that sends to an agent has no guarantee that it will (or will not) see the result of its action a tiny bit later, when the repl prints the stringified version of the agent.

If you want to guarantee that your thread sees the results of its own sends, you can call await. To be sure you were seeing a bug, you would need to

(1) create an agent
(2) have no other threads sending to the agent
(3) send something that caused an error
(4) await

Your example is missing step 4. When I tried it with step 4 included, the behavior was reliable. Of course that doesn't prove that there isn't a bug... :-)

Stu

Cyrus Harmon

unread,
Jul 16, 2010, 2:42:36 PM7/16/10
to clo...@googlegroups.com
Going to http:// clojure.org, searching for git and following the "Clojure goes git" link would lead one to http://groups.google.com/group/clojure/msg/ca4fb58428052554 which suggests that the rickhickey page is the right one. Where's the announcement about git://github.com/clojure ?

thanks,

cyrus

Stefan Kamphausen

unread,
Jul 16, 2010, 2:55:33 PM7/16/10
to Clojure
Hi Stu,

On 16 Jul., 19:54, Stuart Halloway <stuart.hallo...@gmail.com> wrote:
> Hi Stefan,
>
> The behavior you are seeing is not a problem, and understanding why may be helpful to using agents correctly.
>
> The thread that sends to an agent has no guarantee that it will (or will not) see the result of its action a tiny bit later, when the repl prints the stringified version of the agent.

yeah, after posting this I went over to core_print.clj and took a
look. I was also thinking about proposing that the REPL should await
(or better await-for), but since the REPL can't know when the agent
will finish, it wouldn't be good either. I can't think of a reliable
solution for this.

The same thing happens (of course) with the output of the current
value, not just the error-state.


I think the fact that having a thread-pool or not made a difference
got me on the wrong track in the first place.

Best regards,
Stefan

Jeffrey Schwab

unread,
Jul 16, 2010, 2:56:39 PM7/16/10
to clo...@googlegroups.com
On 7/16/10 2:42 PM, Cyrus Harmon wrote:
> Going to http:// clojure.org, searching for git and following the "Clojure goes git" link would lead one to http://groups.google.com/group/clojure/msg/ca4fb58428052554 which suggests that the rickhickey page is the right one. Where's the announcement about git://github.com/clojure ?

http://clojure.org/downloads

"Clojure source code is hosted at github.com/clojure/clojure."

I don't know whether there was any formal announcement.

Stefan Kamphausen

unread,
Jul 16, 2010, 3:46:50 PM7/16/10
to Clojure
Hi,

FWIW...

I've delayed this work for ages, but now that 1.2 is just around the
corner I have no reason to wait any longer. So I went through all [1]
examples from our forthcoming book [2] and tested them with the
current beta. The result of this is encouraging: everything works
fine.

Until now I skipped most of the contrib library and the parts where we
show how to use Clojure stuff from Java. Need something to do for the
weekend ;).

The only issues I had so far where when I tried to include
contrib.repl-utils and ns-utils which clash with other names in the
user-namespace and thus can't be safely included. You can work around
this by :only importing what you need, though.

Kudos!

Hope this helps,
Stefan

[1] I looked at more than 400 verbatim environments in the LaTeX-
sources, containing almost 900 user>-prompts and approximately 300
(defn\?-initions.
Mostly simple examples, but two larger programs, too, which comprise
one or two screen-pages of functions and give the CPUs something to
work on.

[2] http://www.clojure-buch.de (warning: self-ad, even more warning:
German content)

Meikel Brandmeyer

unread,
Jul 17, 2010, 5:50:45 AM7/17/10
to clo...@googlegroups.com
Hi,

It was announced on the dev list:

http://groups.google.com/group/clojure-dev/browse_thread/thread/174b8b17a6d4ad26

Sincerely
Meikel

Jeffrey Schwab

unread,
Jul 17, 2010, 12:44:42 PM7/17/10
to clo...@googlegroups.com
On 7/17/10 5:50 AM, Meikel Brandmeyer wrote:
>> On 7/16/10 2:42 PM, Cyrus Harmon wrote:

>>> Going to http:// clojure.org, searching for git and following the "Clojure goes git" link would lead one to http://groups.google.com/group/clojure/msg/ca4fb58428052554 which suggests that the rickhickey page is the right one. Where's the announcement about git://github.com/clojure ?

> It was announced on the dev list:
>
> http://groups.google.com/group/clojure-dev/browse_thread/thread/174b8b17a6d4ad26

Thanks. Do you know of any NNTP interface to that group? I don't see
it on gmane, and I find the Google Groups interface borderline unusable.

Reply all
Reply to author
Forward
0 new messages