Re: 6 December 2012 - London - Clojure eXchange - Call for Presentations

2012-07-31 Thread cassiel
Yep... my presentation proposal went in last week...

http://skillsmatter.com/event/scala/clojure-exchange 

and
> http://skillsmatter.com/event/scala/clojure-exchange-2012 
>

Indeed; sign up now for what promises to be the best Scala event of 2012.
 
-- N.

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

Double-underscore error in deftype args (Clojure 1.3)

2012-02-27 Thread cassiel
Here's a simple protocol/deftype example:

(defprotocol FOO
  (doit [this]))

(deftype Foo [_arg]
  FOO
  (doit [this] nil))

(deftype Foo [__arg]
  FOO
  (doit [this] nil))

The first definition of Foo compiles; the second gives

(class: user/Foo, method: create signature: (Lclojure/lang/
IPersistentMap;)Luser/Foo;) Expecting to find unitialized object on
stack
  [Thrown class java.lang.VerifyError]

The failure is coming from java.lang.Class.forName(), but that's not
telling me very much (since it's not clear to me which class cannot be
instantiated, or why not).

Oh, and "unitialized" is a typo.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: clojure.contrib.prxml broken in Clojure 1.3.0

2012-01-17 Thread cassiel
Ah: found this thread:

https://groups.google.com/forum/#!topic/clojure-dev/IGD6Ziqt-QY

So: would still be very obliged for a link to an XML-generating
package working under 1.3.0. (I don't need to parse.)

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


clojure.contrib.prxml broken in Clojure 1.3.0

2012-01-17 Thread cassiel
This is straight from the doc string:

(with-out-str (p/prxml [:p {:class "greet"} [:i "Ladies &
gentlemen"]]))

Works in Clojure 1.2.1:

(:ok "\"Ladies & gentlemen\"")

(that's pasted from the slime event buffer, hence the superfluous
armour.)

Fails in Clojure 1.3.0:

clojure.lang.Numbers.lt(II)Z
  [Thrown class java.lang.NoSuchMethodError]

Is prxml still being supported? If not, is there a better Clojure-DSL-
to-XML package?

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: osc-clj 0.5.0 - Open Sound Control for Clojure

2011-08-16 Thread cassiel
Nice work. Perhaps it's getting to be time to retire my own Java OSC
library...

Is this reachable via Lein/Maven?

-- N.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Java 7 is out!

2011-07-29 Thread cassiel
On Jul 29, 1:18 am, Ken Wesson  wrote:
> On the one hand, assuming that Java 7 doesn't outright break anything, [...]

Like loops?

http://www.lucidimagination.com/blog/2011/07/28/dont-use-java-7-for-anything/

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: determining whether state has changed in a thread safe manner

2011-07-25 Thread cassiel
Of course, once posted, I realised the conditional could be
eliminated:

(defn update-and-check-whether-modified?
  [update-fn]
  (:changed?
   (swap! a (fn [{v :value _ :changed?}]
  (let [new-v (update-fn v)]
{:value new-v :changed? (not= v new-v)})

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: determining whether state has changed in a thread safe manner

2011-07-25 Thread cassiel
Hi Sam,

A nice late night exercise...

Not very practical, but if you want a safe transaction-free operation
on an atom which returns whether it was changed, you can perhaps hack
it by embedding the change state into the atom itself:

(def a (atom {:value 45 :changed? false}))

(defn update-and-check-whether-modified?
  [update-fn]
  (:changed?
   (swap! a (fn [{v :value _ :changed?}]
  (let [new-v (update-fn v)]
(if (== v new-v)
  {:value new-v :changed? false}
  {:value new-v :changed? true}))

(update-and-check-whether-modified? (fn [x] (+ x 1)))
(update-and-check-whether-modified? (fn [x] 70))

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread cassiel
Clojure newcomer here, but here's the thought that's frontmost in my
mind about ClojureScript...

I'm used to Clojure as a language that's solidly spot-welded to the
JVM and the Java libraries. Just as "[1 2 3]" is legal portable
Clojure code, so is "(.start (Thread. #(...)))" despite it being a
blatant set of calls into Java, and so are the various Java-leaning
reflection features.

I think ClojureScript is a great piece of work, but I'm not sure what
this means for language standardisation or portability. Is it still
"real" Clojure? Clearly I can write programs, or distribute libraries,
which run on one but not the other. Similarly, I'm sure there are
common chunks of functionality (although I'm not enough of a JS
programmer to suggest any) which are pretty crucial to some programs
written in either Clojure but implemented differently. ClojureScript
is still missing key parts of Clojure (e.g. agents) making even non-
Java-ish programs non(-yet)-portable.

I guess I'm interested in the road map, if any: are things heading
towards some kind of common "ClojureCore" specification with
ClojureJava and ClojureScript both supersets of this? What are the
ramifications for library distribution? Or are "Clojure Classic" and
ClojureScript different systems for different environments? In which
case, what mileage is there in identifying and specifying the
overlapping and identical areas and transparently developing for both?

Sorry if the questions are stupid... I'm looking forward to having a
good solid session with ClojureScript in a browser near me soon.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Agents not updating in lein swank or lein repl

2011-07-03 Thread cassiel
(Have just found the leiningen google group - will post there - sorry
for the noise.)

-- N.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Agents not updating in lein swank or lein repl

2011-07-03 Thread cassiel
Quick update: lein repl works fine (agent values updating) if I run it
outside my project; agent updates don't work if I run it inside my
project.

Tried on OS X and Ubuntu.

-- N.

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


Agents not updating in lein swank or lein repl

2011-07-02 Thread cassiel
This must be something really stupid I'm doing...

If I run a vanilla clojure repl via java -jar clojure-xxx.jar, then
agents do what I'd except. Ditto using Leiningen's generated
standalone swank-clojure server.

If I do a "lein repl" or connect to a "lein swank" in a simple
project, then agents don't update with sent values. Even the simplest
example like

(def a (agent 0))
(send a (fn [_] 99))

doesn't cause any change.

I guess something's up with the agent thread pool. Should I expect
proper agent behaviour inside a lein session? Am I missing a
project.clj configuration option?

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