[ANN] Quil 2.2.2 Release

2014-09-08 Thread Nikita Beloglazov
Happy to announce release of Quil 2.2.2. It is available on clojars:
https://clojars.org/quil

Here is the list of changes:

   - Processing.js is shipped in a jar to make it possible to include it
   using :preamble option to cljsbuild configuration.
   - Support available-fonts, load-pixels and pixels functions in cljs
   version.
   - Fix bug that prevented from using Quil cljs on headless servers.
   - Fix bugs that prevented Quil from automatically adding canvas to a
   page if the page is empty.
   - Documentation fixes.

Many thanks to contributors.

Happy hacking!
Nikita

-- 
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 statechart / hierarchical FSM implementation

2014-09-08 Thread Andre vd Merwe
On Mon, 2014-09-08 at 04:59 +0200, Kevin Lynagh wrote:
 and Horrocks' excellent Constructing the User Interface with
 Statecharts
 (http://www.amazon.com/Constructing-User-Interface-Statecharts-Horrocks/dp/0201342782).

 If you end up exploring the space and want to discuss
 design/implementation issues re: statecharts, I'd be happy to discuss
 off-list.

Hi Kevin,

Thanks for the links. I'll take a look at those. I'm considering
starting off small and seeing what I can do in as functional way as
possible. If I make any progress I'll definitely send you an email.


Andre


Information contained in this e-mail, including attachments and any rights 
hereto are the property of Portfolio Prospecting and Performance (Pty) Ltd 
(unless the context clearly indicates otherwise). It is confidential, private 
and intended for the addressee only and should you not be the addressee and 
receive it by mistake, kindly notify the sender and delete this information 
immediately without further disclosure to any other party. Save for bona fide 
views of Portfolio Prospecting and Performance (Pty) Ltd, views and opinions 
expressed in this e-mail are those of the sender only. Portfolio Prospecting 
and Performance (Pty) Ltd accepts no liability whatsoever for any loss or 
damages incurred, or suffered, arising from the use the information in this 
e-mail. Portfolio Prospecting and Performance (Pty) Ltd does not warrant the 
integrity of this e-mail nor that it is free of errors, viruses, interception 
or interference

-- 
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] Nginx-Clojure v0.2.5 released!

2014-09-08 Thread gvim

On 08/09/2014 04:20, Xfeep wrote:

  In addition one Java thread will tie up one native OS thread.
A
On Monday, September 8, 2014 10:50:13 AM UTC+8, Yuexiang Zhang wrote:

Not only Wildfly but also most of mainstream pure java webservers
use thread pool to handle http requests. Nginx-Clojure can also be
configurated to use thread pool with one or many JVM instances.

Advanced Java webservers use Java NIO (I/O multipexing) to do the
first phrase (Http request accepting and simple parsing)  then run
user business flow with thread pool. The first phrase only need one
or very few threads. But at the second phrase (using thread pool)
largely existing Java Socket API based libraries such as JDBC
drivers, Http Client are  blocking so if there are many connections
they 'll eat up all threads and make the webserver hang because a OS
can only support less threads than connections. By the way threads
in JVM are not cheap and they use more memory than pure native OS
threads and OS threads are pre-emptive and scheduled at constant
time slice so if there are too many threads scheduling will cost too
many of cpu cycles to do real works.

For large scalar application one JVM instance is really not enough.
Typical scenario is we use serveral Java webservers such as tomcat,
jetty, glassfish etc, and
put a reverse proxy such as Nginx, Haproxy, Apache in the front of
them. And Nginx-Clojure make this work easier because it can
automatic embed JVM instances into Nginx worker processes and we
need not maintain too many webservers.

Since JDK 5, JVM instances can share Class data to reduce memory
usage and the startup time for java applications. And on our
  enviroment typically we use coroutine based sockets to work with
Apache http client , Solr client ,etc. Coroutines are cooperative
and cheaper than threads and be created as much as our memory can bear.

Xfeep



Thanks. Very informative. 'Looks like Nginx-Clojure is a good option.

gvim

--
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: Interop nightmare

2014-09-08 Thread Jony Hudson
Not the answer, but might have some useful clues in ... here's a snippet to 
make a tagger from the Stanford library:

(ns processor.tagger
  (:require [clojure.data.xml :as xml]
[clojure.string :as string])
  (:import (edu.stanford.nlp.tagger.maxent TaggerConfig MaxentTagger)))


;; Configuration information for the Stanford POS tagger
(def conf
  (TaggerConfig.
(into-array [-model 
resources/models/english-caseless-left3words-distsim.tagger
 -outputFormat xml
 -outputFormatOptions lemmatize])))


(def tagger (MaxentTagger. 
resources/models/english-caseless-left3words-distsim.tagger conf))



Jony

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


Does lein midje also run tests written using expectations?

2014-09-08 Thread Vineet Naik
Hello,

I am using expectations for writing tests in a code base that already
has other tests written using midje. What I observed is that running
`lein midje` also runs tests written using expectations. The functions
defined in the expectations-options namespace (with meta-data
:before-run, :after-run etc.) are also called.

While having a single command for running both types of tests would be
great, I couldn't find anything mentioned about this in the midje or
lein-midje docs nor in the code (although I could be missing it
because of my limited understanding of midje's code).

Just need to confirm that the behaviour is intentional and not just by
chance.

Thanks,
Vineet

-- 
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: org.clojure/tools.namespace 0.2.6

2014-09-08 Thread Stuart Sierra
tools.namespace: parse namespace declarations and reload files in
dependency order.

https://github.com/clojure/tools.namespace

Release 0.2.6 contains the following bugfixes:

  * `clojure.tools.namespace.parse/read-ns-decl` asserts that its
argument is a PushbackReader, instead of silently returning nil

  * Fix [TNS-22]: broken `clojure.string/replace` with Windows path
separator

Leiningen dependency information:

[org.clojure/tools.namespace 0.2.6]

This is a Clojure-contrib project,
http://dev.clojure.org/display/doc/Clojure+Contrib


-- 
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: Does lein midje also run tests written using expectations?

2014-09-08 Thread Tobias Kortkamp

That `lein midje` runs your expectations is just a side effect of
expectations' behavior to run its tests on JVM shutdown. Use 
`(expectations/disable-run-on-shutdown)` to disable that feature.


 Just need to confirm that the behaviour is intentional and not just by

chance.


I guess it's a little bit of both ;-)


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

2014-09-08 Thread Frantisek Sodomka
Hello,
I posted a question about volatiles on the github commit:
https://github.com/clojure/clojure/commit/60440977823752f13a3fec3637538e9a1d68c5d4

I don't know if anybody noticed, so... why is volatile created with 
function volatile! and not volatile ? Atoms, refs and agents don't have 
exclamation mark in their constructor functions.

Should I think about volatiles as mutable locals?  :-)

František


On Friday, September 5, 2014 4:26:53 PM UTC+2, Alex Miller wrote:

 Clojure 1.7.0-alpha1 is now available. 
  
 Try it via 
 - Download: 
 http://central.maven.org/maven2/org/clojure/clojure/1.7.0-alpha2/
 - Download securely: 
 https://repo1.maven.org/maven2/org/clojure/clojure/1.7.0-alpha2/
 - Leiningen: [org.clojure/clojure 1.7.0-alpha2]

 Highlights below, full change log here:
 https://github.com/clojure/clojure/blob/master/changes.md

 For users of Clojure 1.7.0-alpha1, there have been a few important changes 
 in transducers since alpha1:
 - Removed flatmap transducer
 - Added cat transducer
 - mapcat 1-arity is now a transducer, specifically: (comp (map f) cat)
 - The completing function has been lifted to be public

 Clojure 1.7.0-alpha2 has the changes below from 1.6.0:

 ## 1 New and Improved Features

 ### 1.1 Transducers

 Transducers is a new way to decouple algorithmic transformations from their
 application in different contexts. Transducers are functions that transform
 reducing functions to build up a recipe for transformation.

 Also see: http://blog.cognitect.com/blog/2014/8/6/transducers-are-coming

 Many existing sequence functions now have a new arity (one fewer argument
 than before). This arity will return a transducer that represents the same
 logic but is independent of lazy sequence processing. Functions included 
 are:

 * conj (conjs to [])
 * map
 * mapcat
 * filter
 * remove
 * take
 * take-while
 * drop
 * drop-while
 * cycle
 * take-nth
 * replace
 * partition-by
 * partition-all
 * keep
 * keep-indexed

 Additionally some new transducer functions have been added:

 * cat - concatenates the contents of each input
 * de-dupe - removes consecutive duplicated values
 * random-sample - returns items from coll with random probability

 And this function can be used to make completing transforms:

 * completing

 There are also several new or modified functions that can be used to apply
 transducers in different ways:

 * sequence - takes a transformation and a coll and produces a lazy seq
 * transduce - reduce with a transformation (eager)
 * iteration - returns an iterable/seqable/reducible seq of applications of 
 the transducer to items in coll. Applications are re-performed with every 
 iterator/seq/reduce.
 * run! - run the transformation for side effects on the collection

 There have been a number of internal changes to support transducers:

 * volatiles - there are a new set of functions (volatile!, vswap!, 
 vreset!, volatile?) to create and use volatile boxes to hold state in 
 stateful transducers. Volatiles are faster than atoms but give up atomicity 
 guarantees so should only be used with thread isolation.
 * array iterators - added support for iterators over arrays

 Some issues created and addressed during development:
 * [CLJ-1511](http://dev.clojure.org/jira/browse/CLJ-1511)
 * [CLJ-1497](http://dev.clojure.org/jira/browse/CLJ-1497)

 ### 1.2 Keyword and Symbol Construction

 In response to issues raised in [CLJ-1439](
 http://dev.clojure.org/jira/browse/CLJ-1439),
 several changes have been made in symbol and keyword construction:

 1) The main bottleneck in construction of symbols (which also occurs 
 inside keywords) was
 interning of the name and namespace strings. This interning has been 
 removed, resulting
 in a performance increase.

 2) Keywords are cached and keyword construction includes a cache check. A 
 change was made
 to only clear the cache reference queue when there is a cache miss.

 ### 1.3 Warn on Boxed Math

 One source of performance issues is the (unintended) use of arithmetic 
 operations on
 boxed numbers. To make detecting the presence of boxed math easier, a 
 warning will now
 be emitted about boxed math if \*unchecked-math* is enabled.

 Example use:

 user (defn plus-2 [x] (+ x 2))  ;; no warning, but boxed
 #'user/plus-2
 user (set! *unchecked-math* true)
 true
 user (defn plus-2 [x] (+ x 2)) ;; now we see a warning
 Boxed math warning, NO_SOURCE_PATH:10:18 - call: public static 
 java.lang.Number
 clojure.lang.Numbers.unchecked_add(java.lang.Object,long).
 #'user/plus-2
 user (defn plus-2 [^long x] (+ x 2)) ;; use a hint to avoid boxing
 #'user/plus-2

 * [CLJ-1325](http://dev.clojure.org/jira/browse/CLJ-1325)

 ### 1.4 update - like update-in for first level

 `update` is a new function that is like update-in specifically for 
 first-level keys:

 (update m k f args...)

 Example use:

 user (update {:a 1} :a inc)
 {:a 2}
 user (update {:a 1} :a + 2)
 {:a 3}
 user (update {} :a identity)  ;; 

Re: tools.analyzer[.js/.jvm], tools.emitter.jvm, status report

2014-09-08 Thread Michael Griffiths
Hi Nicola,
 
This is great stuff. Are there plans for a tools.emitter.js?
 
Thanks,
 
Michael

-- 
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: Does lein midje also run tests written using expectations?

2014-09-08 Thread Vineet Naik
Oh, that explains it. Thanks.

- Vineet


On Mon, Sep 8, 2014 at 7:13 PM, Tobias Kortkamp tobias.kortk...@gmail.com
wrote:

 That `lein midje` runs your expectations is just a side effect of
 expectations' behavior to run its tests on JVM shutdown. Use
 `(expectations/disable-run-on-shutdown)` to disable that feature.

  Just need to confirm that the behaviour is intentional and not just by

 chance.


 I guess it's a little bit of both ;-)


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




-- 
~ Vineet

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


Books on Functional Algorithms aimed towards undergrad CS?

2014-09-08 Thread Evan Zamir
(First, I should say that I am not an undergrad, haven't been for almost 
two decades! But in terms of my CS knowledge, that's pretty much where I 
am.)

I recently started reading Sedgewick's Algorithms book (the red one) and 
am at least making an attempt to follow along with his Coursera course. As 
someone who has also been trying to learn Clojure, it struck me that it 
would be great to have a resource/book on functional versions of all the 
same algorithms. I know there are Clojure implementations of many, if not 
all, of the algorithms in the book (for example I found an implementation 
of union-find https://github.com/jordanlewis/data.union-find on github), 
but it would be nice to have a self-contained functional version of an 
Algorithms book.

I guess my question boils down to this. Is there a functional algorithms 
book aimed at the beginning/intermediate CS undergraduate curriculum? If 
not, seems to me that would be a big hole that needs to be filled.
-evan

-- 
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: Interop nightmare

2014-09-08 Thread Jacob Goodson
Hey Sam.  I too had great difficulty with clojure interop until I became 
more familiar with Java.  I find that it is quite difficult to use clojure 
unless one knows Java, which I believe to be a barrier to new comers.  So I 
suggest that you learn some Java and start trying to hack simple interop 
programs to get the hang of it.

On Sunday, September 7, 2014 10:50:31 PM UTC-4, Sam Raker wrote:

 I'm trying to use the Stanford Parser from Clojure, but I don't know 
 hardly any Java, and this is my first time working with the interop stuff. 
 All I want to do is play around with the class in the REPL. I added 
 `[edu.stanford.nlp/stanford-parser 3.4.1]` to my Lein `project.clj`, and 
 the download seemed to go fine. The documentation is 
 http://nlp.stanford.edu/nlp/javadoc/javanlp/edu/stanford/nlp/parser/lexparser/LexicalizedParser.html
  
 for those of you playing at home.

 Basically, my efforts have been a total failure. I can `(import 
 edu.stanford.nlp.parser.lexparser.LexicalizedParser)`, but after that, it's 
 just a nightmare of `no matching ctor`, `no matching field`, 
 `NoSuchFieldException` and `expected static field` errors. I can't even 
 initialize anything -- `(def parser (new LexicalizedParser))` gives me the 
 aforementioned `no matching ctor` error.

 Like I said before, this is entirely my fault: I don't know Java, I don't 
 know interop, and I Google has failed me. So I turn to you, beloved Clojure 
 community, to correct my ignorance. I'm sure it's not hard, I'm just 
 missing something.


 Thanks,
 -sam


-- 
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: Interop nightmare

2014-09-08 Thread Jony Hudson
This worked for me:

http://viewer.gorilla-repl.org/view.html?source=gistid=5baef8ac0f42706e4940filename=parser.clj

I had to download the parser distribution from the Stanford NLP site and 
copy the stanford-parser-3.4.1-models.jar file into the root of my 
Leiningen project, as I couldn't find it on maven.

Hope that helps,


Jony


-- 
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: Interop nightmare

2014-09-08 Thread Sean Corfield
On Sep 8, 2014, at 10:08 AM, Jacob Goodson submissionfight...@gmx.com wrote:
 Hey Sam.  I too had great difficulty with clojure interop until I became more 
 familiar with Java.

Yeah, the interop can be painful, especially with the way some Java libraries 
are designed - and you can end up with some pretty ugly Clojure when dealing 
with those libraries (still a lot nicer than the Java you'd have to write!).

 I find that it is quite difficult to use clojure unless one knows Java, which 
 I believe to be a barrier to new comers.

I'm surprised every time I hear this. You can write a lot of Clojure without 
having to do any interop so you can mostly ignore Java altogether unless you 
specifically want to work with a Java library. Yes, the stacktraces bleed Java 
but after the initial OMG! shock, they're generally easy to read - they're 
just LONG and you have to ignore a lot of the irrelevant parts. Leiningen 
mostly hides the ugly Java ecosystem as regards library management so, again, 
you can mostly ignore Java there too.

Certainly if you're new to Clojure and don't know Java, you want to avoid doing 
things that require you to interop with Java libraries until you're more 
comfortable with Clojure itself.

 So I suggest that you learn some Java and start trying to hack simple interop 
 programs to get the hang of it.

Good advice. Practicing with interop on the Java String class or something else 
that's relatively simple is a nice way to ease into it. Having had to work 
with Java's JDBC classes, javax.mail, and Java's SOAP implementation - all from 
Clojure - all I can say is that some Java interop is easier than others, but 
most of it is somewhat unpleasant :)

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

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)





signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [ANN] Clojure 1.7.0-alpha2

2014-09-08 Thread Jozef Wagner
FYI the ticket about volatile is at
http://dev.clojure.org/jira/browse/CLJ-1512 and the same question was
raised there.

On Mon, Sep 8, 2014 at 4:25 PM, Frantisek Sodomka fsodo...@gmail.com wrote:
 Hello,
 I posted a question about volatiles on the github commit:
 https://github.com/clojure/clojure/commit/60440977823752f13a3fec3637538e9a1d68c5d4

 I don't know if anybody noticed, so... why is volatile created with function
 volatile! and not volatile ? Atoms, refs and agents don't have
 exclamation mark in their constructor functions.

 Should I think about volatiles as mutable locals?  :-)

 František


 On Friday, September 5, 2014 4:26:53 PM UTC+2, Alex Miller wrote:

 Clojure 1.7.0-alpha1 is now available.

 Try it via
 - Download:
 http://central.maven.org/maven2/org/clojure/clojure/1.7.0-alpha2/
 - Download securely:
 https://repo1.maven.org/maven2/org/clojure/clojure/1.7.0-alpha2/
 - Leiningen: [org.clojure/clojure 1.7.0-alpha2]

 Highlights below, full change log here:
 https://github.com/clojure/clojure/blob/master/changes.md

 For users of Clojure 1.7.0-alpha1, there have been a few important changes
 in transducers since alpha1:
 - Removed flatmap transducer
 - Added cat transducer
 - mapcat 1-arity is now a transducer, specifically: (comp (map f) cat)
 - The completing function has been lifted to be public

 Clojure 1.7.0-alpha2 has the changes below from 1.6.0:

 ## 1 New and Improved Features

 ### 1.1 Transducers

 Transducers is a new way to decouple algorithmic transformations from
 their
 application in different contexts. Transducers are functions that
 transform
 reducing functions to build up a recipe for transformation.

 Also see: http://blog.cognitect.com/blog/2014/8/6/transducers-are-coming

 Many existing sequence functions now have a new arity (one fewer argument
 than before). This arity will return a transducer that represents the same
 logic but is independent of lazy sequence processing. Functions included
 are:

 * conj (conjs to [])
 * map
 * mapcat
 * filter
 * remove
 * take
 * take-while
 * drop
 * drop-while
 * cycle
 * take-nth
 * replace
 * partition-by
 * partition-all
 * keep
 * keep-indexed

 Additionally some new transducer functions have been added:

 * cat - concatenates the contents of each input
 * de-dupe - removes consecutive duplicated values
 * random-sample - returns items from coll with random probability

 And this function can be used to make completing transforms:

 * completing

 There are also several new or modified functions that can be used to apply
 transducers in different ways:

 * sequence - takes a transformation and a coll and produces a lazy seq
 * transduce - reduce with a transformation (eager)
 * iteration - returns an iterable/seqable/reducible seq of applications of
 the transducer to items in coll. Applications are re-performed with every
 iterator/seq/reduce.
 * run! - run the transformation for side effects on the collection

 There have been a number of internal changes to support transducers:

 * volatiles - there are a new set of functions (volatile!, vswap!,
 vreset!, volatile?) to create and use volatile boxes to hold state in
 stateful transducers. Volatiles are faster than atoms but give up atomicity
 guarantees so should only be used with thread isolation.
 * array iterators - added support for iterators over arrays

 Some issues created and addressed during development:
 * [CLJ-1511](http://dev.clojure.org/jira/browse/CLJ-1511)
 * [CLJ-1497](http://dev.clojure.org/jira/browse/CLJ-1497)

 ### 1.2 Keyword and Symbol Construction

 In response to issues raised in
 [CLJ-1439](http://dev.clojure.org/jira/browse/CLJ-1439),
 several changes have been made in symbol and keyword construction:

 1) The main bottleneck in construction of symbols (which also occurs
 inside keywords) was
 interning of the name and namespace strings. This interning has been
 removed, resulting
 in a performance increase.

 2) Keywords are cached and keyword construction includes a cache check. A
 change was made
 to only clear the cache reference queue when there is a cache miss.

 ### 1.3 Warn on Boxed Math

 One source of performance issues is the (unintended) use of arithmetic
 operations on
 boxed numbers. To make detecting the presence of boxed math easier, a
 warning will now
 be emitted about boxed math if \*unchecked-math* is enabled.

 Example use:

 user (defn plus-2 [x] (+ x 2))  ;; no warning, but boxed
 #'user/plus-2
 user (set! *unchecked-math* true)
 true
 user (defn plus-2 [x] (+ x 2)) ;; now we see a warning
 Boxed math warning, NO_SOURCE_PATH:10:18 - call: public static
 java.lang.Number
 clojure.lang.Numbers.unchecked_add(java.lang.Object,long).
 #'user/plus-2
 user (defn plus-2 [^long x] (+ x 2)) ;; use a hint to avoid boxing
 #'user/plus-2

 * [CLJ-1325](http://dev.clojure.org/jira/browse/CLJ-1325)

 ### 1.4 update - like update-in for first level

 `update` is a new function that is like update-in specifically 

Re: [ANN] Clojure 1.7.0-alpha2

2014-09-08 Thread Alex Miller
I asked Rich and he said making a volatile is as dangerous as any ! op.

Some people have also asked about vswap! being a macro instead of a method
on Volatile. The issue there is that vswap! takes a variadic number of
update function args. If implemented as a method, you'd need to provide
multiple arities or eventually use apply (like in Atom's swap!
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Atom.java#L79)
- doing it in a macro lets that expansion take place at compile time to
provide better performance without the apply.





On Mon, Sep 8, 2014 at 1:36 PM, Jozef Wagner jozef.wag...@gmail.com wrote:

 FYI the ticket about volatile is at
 http://dev.clojure.org/jira/browse/CLJ-1512 and the same question was
 raised there.

 On Mon, Sep 8, 2014 at 4:25 PM, Frantisek Sodomka fsodo...@gmail.com
 wrote:
  Hello,
  I posted a question about volatiles on the github commit:
 
 https://github.com/clojure/clojure/commit/60440977823752f13a3fec3637538e9a1d68c5d4
 
  I don't know if anybody noticed, so... why is volatile created with
 function
  volatile! and not volatile ? Atoms, refs and agents don't have
  exclamation mark in their constructor functions.
 
  Should I think about volatiles as mutable locals?  :-)
 
  František
 
 
  On Friday, September 5, 2014 4:26:53 PM UTC+2, Alex Miller wrote:
 
  Clojure 1.7.0-alpha1 is now available.
 
  Try it via
  - Download:
  http://central.maven.org/maven2/org/clojure/clojure/1.7.0-alpha2/
  - Download securely:
  https://repo1.maven.org/maven2/org/clojure/clojure/1.7.0-alpha2/
  - Leiningen: [org.clojure/clojure 1.7.0-alpha2]
 
  Highlights below, full change log here:
  https://github.com/clojure/clojure/blob/master/changes.md
 
  For users of Clojure 1.7.0-alpha1, there have been a few important
 changes
  in transducers since alpha1:
  - Removed flatmap transducer
  - Added cat transducer
  - mapcat 1-arity is now a transducer, specifically: (comp (map f) cat)
  - The completing function has been lifted to be public
 
  Clojure 1.7.0-alpha2 has the changes below from 1.6.0:
 
  ## 1 New and Improved Features
 
  ### 1.1 Transducers
 
  Transducers is a new way to decouple algorithmic transformations from
  their
  application in different contexts. Transducers are functions that
  transform
  reducing functions to build up a recipe for transformation.
 
  Also see:
 http://blog.cognitect.com/blog/2014/8/6/transducers-are-coming
 
  Many existing sequence functions now have a new arity (one fewer
 argument
  than before). This arity will return a transducer that represents the
 same
  logic but is independent of lazy sequence processing. Functions included
  are:
 
  * conj (conjs to [])
  * map
  * mapcat
  * filter
  * remove
  * take
  * take-while
  * drop
  * drop-while
  * cycle
  * take-nth
  * replace
  * partition-by
  * partition-all
  * keep
  * keep-indexed
 
  Additionally some new transducer functions have been added:
 
  * cat - concatenates the contents of each input
  * de-dupe - removes consecutive duplicated values
  * random-sample - returns items from coll with random probability
 
  And this function can be used to make completing transforms:
 
  * completing
 
  There are also several new or modified functions that can be used to
 apply
  transducers in different ways:
 
  * sequence - takes a transformation and a coll and produces a lazy seq
  * transduce - reduce with a transformation (eager)
  * iteration - returns an iterable/seqable/reducible seq of applications
 of
  the transducer to items in coll. Applications are re-performed with
 every
  iterator/seq/reduce.
  * run! - run the transformation for side effects on the collection
 
  There have been a number of internal changes to support transducers:
 
  * volatiles - there are a new set of functions (volatile!, vswap!,
  vreset!, volatile?) to create and use volatile boxes to hold state in
  stateful transducers. Volatiles are faster than atoms but give up
 atomicity
  guarantees so should only be used with thread isolation.
  * array iterators - added support for iterators over arrays
 
  Some issues created and addressed during development:
  * [CLJ-1511](http://dev.clojure.org/jira/browse/CLJ-1511)
  * [CLJ-1497](http://dev.clojure.org/jira/browse/CLJ-1497)
 
  ### 1.2 Keyword and Symbol Construction
 
  In response to issues raised in
  [CLJ-1439](http://dev.clojure.org/jira/browse/CLJ-1439),
  several changes have been made in symbol and keyword construction:
 
  1) The main bottleneck in construction of symbols (which also occurs
  inside keywords) was
  interning of the name and namespace strings. This interning has been
  removed, resulting
  in a performance increase.
 
  2) Keywords are cached and keyword construction includes a cache check.
 A
  change was made
  to only clear the cache reference queue when there is a cache miss.
 
  ### 1.3 Warn on Boxed Math
 
  One source of performance issues is the (unintended) use of arithmetic
  operations 

Re: [ANN] Clojure 1.7.0-alpha2

2014-09-08 Thread Luc Prefontaine
+1 for the !

No atomic changes here, no coordination whatsoever.

At the mercy of the caller...

 I asked Rich and he said making a volatile is as dangerous as any ! op.
 
 Some people have also asked about vswap! being a macro instead of a method
 on Volatile. The issue there is that vswap! takes a variadic number of
 update function args. If implemented as a method, you'd need to provide
 multiple arities or eventually use apply (like in Atom's swap!
 https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Atom.java#L79)
 - doing it in a macro lets that expansion take place at compile time to
 provide better performance without the apply.
 
 
 
 
 
 On Mon, Sep 8, 2014 at 1:36 PM, Jozef Wagner jozef.wag...@gmail.com wrote:
 
  FYI the ticket about volatile is at
  http://dev.clojure.org/jira/browse/CLJ-1512 and the same question was
  raised there.
 
  On Mon, Sep 8, 2014 at 4:25 PM, Frantisek Sodomka fsodo...@gmail.com
  wrote:
   Hello,
   I posted a question about volatiles on the github commit:
  
  https://github.com/clojure/clojure/commit/60440977823752f13a3fec3637538e9a1d68c5d4
  
   I don't know if anybody noticed, so... why is volatile created with
  function
   volatile! and not volatile ? Atoms, refs and agents don't have
   exclamation mark in their constructor functions.
  
   Should I think about volatiles as mutable locals?  :-)
  
   František
  
  
   On Friday, September 5, 2014 4:26:53 PM UTC+2, Alex Miller wrote:
  
   Clojure 1.7.0-alpha1 is now available.
  
   Try it via
   - Download:
   http://central.maven.org/maven2/org/clojure/clojure/1.7.0-alpha2/
   - Download securely:
   https://repo1.maven.org/maven2/org/clojure/clojure/1.7.0-alpha2/
   - Leiningen: [org.clojure/clojure 1.7.0-alpha2]
  
   Highlights below, full change log here:
   https://github.com/clojure/clojure/blob/master/changes.md
  
   For users of Clojure 1.7.0-alpha1, there have been a few important
  changes
   in transducers since alpha1:
   - Removed flatmap transducer
   - Added cat transducer
   - mapcat 1-arity is now a transducer, specifically: (comp (map f) cat)
   - The completing function has been lifted to be public
  
   Clojure 1.7.0-alpha2 has the changes below from 1.6.0:
  
   ## 1 New and Improved Features
  
   ### 1.1 Transducers
  
   Transducers is a new way to decouple algorithmic transformations from
   their
   application in different contexts. Transducers are functions that
   transform
   reducing functions to build up a recipe for transformation.
  
   Also see:
  http://blog.cognitect.com/blog/2014/8/6/transducers-are-coming
  
   Many existing sequence functions now have a new arity (one fewer
  argument
   than before). This arity will return a transducer that represents the
  same
   logic but is independent of lazy sequence processing. Functions included
   are:
  
   * conj (conjs to [])
   * map
   * mapcat
   * filter
   * remove
   * take
   * take-while
   * drop
   * drop-while
   * cycle
   * take-nth
   * replace
   * partition-by
   * partition-all
   * keep
   * keep-indexed
  
   Additionally some new transducer functions have been added:
  
   * cat - concatenates the contents of each input
   * de-dupe - removes consecutive duplicated values
   * random-sample - returns items from coll with random probability
  
   And this function can be used to make completing transforms:
  
   * completing
  
   There are also several new or modified functions that can be used to
  apply
   transducers in different ways:
  
   * sequence - takes a transformation and a coll and produces a lazy seq
   * transduce - reduce with a transformation (eager)
   * iteration - returns an iterable/seqable/reducible seq of applications
  of
   the transducer to items in coll. Applications are re-performed with
  every
   iterator/seq/reduce.
   * run! - run the transformation for side effects on the collection
  
   There have been a number of internal changes to support transducers:
  
   * volatiles - there are a new set of functions (volatile!, vswap!,
   vreset!, volatile?) to create and use volatile boxes to hold state in
   stateful transducers. Volatiles are faster than atoms but give up
  atomicity
   guarantees so should only be used with thread isolation.
   * array iterators - added support for iterators over arrays
  
   Some issues created and addressed during development:
   * [CLJ-1511](http://dev.clojure.org/jira/browse/CLJ-1511)
   * [CLJ-1497](http://dev.clojure.org/jira/browse/CLJ-1497)
  
   ### 1.2 Keyword and Symbol Construction
  
   In response to issues raised in
   [CLJ-1439](http://dev.clojure.org/jira/browse/CLJ-1439),
   several changes have been made in symbol and keyword construction:
  
   1) The main bottleneck in construction of symbols (which also occurs
   inside keywords) was
   interning of the name and namespace strings. This interning has been
   removed, resulting
   in a performance increase.
  
   2) Keywords are cached and keyword 

Re: Books on Functional Algorithms aimed towards undergrad CS?

2014-09-08 Thread Laurent PETIT
Shameless plug (and not really answering the question):

I've created a version of union-find, inspired by the mentioned library,
but using the vocabulary of the course, pure datastructures (and a harmless
volatile to transparently implement path reduction).

I've also tried to document the readme as clearly as possible:

https://github.com/laurentpetit/union-find/blob/master/README.md

Le lundi 8 septembre 2014, Evan Zamir zamir.e...@gmail.com a écrit :

 (First, I should say that I am not an undergrad, haven't been for almost
 two decades! But in terms of my CS knowledge, that's pretty much where I
 am.)

 I recently started reading Sedgewick's Algorithms book (the red one) and
 am at least making an attempt to follow along with his Coursera course. As
 someone who has also been trying to learn Clojure, it struck me that it
 would be great to have a resource/book on functional versions of all the
 same algorithms. I know there are Clojure implementations of many, if not
 all, of the algorithms in the book (for example I found an implementation
 of union-find https://github.com/jordanlewis/data.union-find on
 github), but it would be nice to have a self-contained functional version
 of an Algorithms book.

 I guess my question boils down to this. Is there a functional algorithms
 book aimed at the beginning/intermediate CS undergraduate curriculum? If
 not, seems to me that would be a big hole that needs to be filled.
 -evan

 --
 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
 javascript:_e(%7B%7D,'cvml','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
 javascript:_e(%7B%7D,'cvml','clojure%2bunsubscr...@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
 javascript:_e(%7B%7D,'cvml','clojure%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/d/optout.



-- 
Laurent Petit

-- 
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: Interop nightmare

2014-09-08 Thread Brian Craft


On Monday, September 8, 2014 11:09:50 AM UTC-7, Sean Corfield wrote:

  I find that it is quite difficult to use clojure unless one knows Java, 
 which I believe to be a barrier to new comers. 

 I'm surprised every time I hear this. You can write a lot of Clojure 
 without having to do any interop so you can mostly ignore Java altogether 
 unless you specifically want to work with a Java library. Yes, the 
 stacktraces bleed Java but after the initial OMG! shock, they're 
 generally easy to read - they're just LONG and you have to ignore a lot of 
 the irrelevant parts. Leiningen mostly hides the ugly Java ecosystem as 
 regards library management so, again, you can mostly ignore Java there too. 


Coming to clojure with no java experience is pretty brutal, in my 
experience. You absolutely can't ignore the Java, because of the 
embrace-the-platform architecture. I suspect this difficulty is surprising 
to java developers because it's so easy to forget how much one has learned. 
An error message like no matching ctor is very confusing without Java 
experience. It takes only a few minutes on google to sort this out, but 
there are at least hundreds of details like this that bleed through from 
Java. It adds up quickly.

-- 
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: Books on Functional Algorithms aimed towards undergrad CS?

2014-09-08 Thread Evan Zamir
Thanks I'll check it out! Is your sense that there really isn't a book that 
fits this target right now?

On Monday, September 8, 2014 12:45:46 PM UTC-7, Laurent PETIT wrote:

 Shameless plug (and not really answering the question):

 I've created a version of union-find, inspired by the mentioned library, 
 but using the vocabulary of the course, pure datastructures (and a harmless 
 volatile to transparently implement path reduction).

 I've also tried to document the readme as clearly as possible:

 https://github.com/laurentpetit/union-find/blob/master/README.md

 Le lundi 8 septembre 2014, Evan Zamir zamir...@gmail.com javascript: 
 a écrit :

 (First, I should say that I am not an undergrad, haven't been for almost 
 two decades! But in terms of my CS knowledge, that's pretty much where I 
 am.)

 I recently started reading Sedgewick's Algorithms book (the red one) 
 and am at least making an attempt to follow along with his Coursera course. 
 As someone who has also been trying to learn Clojure, it struck me that it 
 would be great to have a resource/book on functional versions of all the 
 same algorithms. I know there are Clojure implementations of many, if not 
 all, of the algorithms in the book (for example I found an implementation 
 of union-find https://github.com/jordanlewis/data.union-find on 
 github), but it would be nice to have a self-contained functional version 
 of an Algorithms book.

 I guess my question boils down to this. Is there a functional algorithms 
 book aimed at the beginning/intermediate CS undergraduate curriculum? If 
 not, seems to me that would be a big hole that needs to be filled.
 -evan

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



 -- 
 Laurent Petit



-- 
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: Books on Functional Algorithms aimed towards undergrad CS?

2014-09-08 Thread Laurent PETIT
There is the classic Purely Functional datastructures by Okasaki. I
haven't read it, the examples are in standard ML if I remember correctly.

CTM, Concepts Techniques and Models of Computer Programming, develops
datastructures and algorithms above a functional core. I haven't read it
front to end to know if it presents algorithms, but I know it covers all
major paradigms, concepts of virtual machines, threads, memory consumption
and management, garbage collection, etc. I've followed the Course on edx.com
by Peter Van Roy and had a lot of fun (yeah, really). Coming from Clojure,
I felt at home with the functional paradigm presented, and could focus on
the big picture that was presented there.

Then lots of books will, I guess, present versions of algorithms in impure
/ imperative forms. It was quite interesting to see how to tweak the
original union-find algorithm to use pre-existing clojure datastructures.
My guess is that generally you'll have to use maps instead of arrays (in
the case of union-find, it then creates a less optimized algorithms, but a
more generic one where keys/site can be any value, not just array indices).
And then see when you can replace index-based algorithms with reduce/fold
applications.

I would be happy to learn about such books








2014-09-08 22:14 GMT+02:00 Evan Zamir zamir.e...@gmail.com:

 Thanks I'll check it out! Is your sense that there really isn't a book
 that fits this target right now?

 On Monday, September 8, 2014 12:45:46 PM UTC-7, Laurent PETIT wrote:

 Shameless plug (and not really answering the question):

 I've created a version of union-find, inspired by the mentioned library,
 but using the vocabulary of the course, pure datastructures (and a harmless
 volatile to transparently implement path reduction).

 I've also tried to document the readme as clearly as possible:

 https://github.com/laurentpetit/union-find/blob/master/README.md

 Le lundi 8 septembre 2014, Evan Zamir zamir...@gmail.com a écrit :

 (First, I should say that I am not an undergrad, haven't been for almost
 two decades! But in terms of my CS knowledge, that's pretty much where I
 am.)

 I recently started reading Sedgewick's Algorithms book (the red one)
 and am at least making an attempt to follow along with his Coursera course.
 As someone who has also been trying to learn Clojure, it struck me that it
 would be great to have a resource/book on functional versions of all the
 same algorithms. I know there are Clojure implementations of many, if not
 all, of the algorithms in the book (for example I found an implementation
 of union-find https://github.com/jordanlewis/data.union-find on
 github), but it would be nice to have a self-contained functional version
 of an Algorithms book.

 I guess my question boils down to this. Is there a functional algorithms
 book aimed at the beginning/intermediate CS undergraduate curriculum? If
 not, seems to me that would be a big hole that needs to be filled.
 -evan

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



 --
 Laurent Petit

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




-- 
Laurent Petit

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

Re: Interop nightmare

2014-09-08 Thread Ivan L
For an enterprising clojure hacker, this is a good opportunity to write 
Clojure for non-Java Hackers and put it up on Pragprog.

On Sunday, September 7, 2014 10:50:31 PM UTC-4, Sam Raker wrote:

 I'm trying to use the Stanford Parser from Clojure, but I don't know 
 hardly any Java, and this is my first time working with the interop stuff. 
 All I want to do is play around with the class in the REPL. I added 
 `[edu.stanford.nlp/stanford-parser 3.4.1]` to my Lein `project.clj`, and 
 the download seemed to go fine. The documentation is 
 http://nlp.stanford.edu/nlp/javadoc/javanlp/edu/stanford/nlp/parser/lexparser/LexicalizedParser.html
  
 for those of you playing at home.

 Basically, my efforts have been a total failure. I can `(import 
 edu.stanford.nlp.parser.lexparser.LexicalizedParser)`, but after that, it's 
 just a nightmare of `no matching ctor`, `no matching field`, 
 `NoSuchFieldException` and `expected static field` errors. I can't even 
 initialize anything -- `(def parser (new LexicalizedParser))` gives me the 
 aforementioned `no matching ctor` error.

 Like I said before, this is entirely my fault: I don't know Java, I don't 
 know interop, and I Google has failed me. So I turn to you, beloved Clojure 
 community, to correct my ignorance. I'm sure it's not hard, I'm just 
 missing something.


 Thanks,
 -sam


-- 
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: Books on Functional Algorithms aimed towards undergrad CS?

2014-09-08 Thread Chris Sims
On Mon, Sep 8, 2014, at 10:04 AM, Evan Zamir wrote:

(First, I should say that I am not an undergrad, haven't been
for almost two decades! But in terms of my CS knowledge, that's
pretty much where I am.)

I recently started reading Sedgewick's Algorithms book (the
red one) and am at least making an attempt to follow along
with his Coursera course. As someone who has also been trying
to learn Clojure, it struck me that it would be great to have a
resource/book on functional versions of all the same
algorithms. I know there are Clojure implementations of many,
if not all, of the algorithms in the book (for example I found
an [1]implementation of union-find on github), but it would be
nice to have a self-contained functional version of an
Algorithms book.

I guess my question boils down to this. Is there a functional
algorithms book aimed at the beginning/intermediate CS
undergraduate curriculum? If not, seems to me that would be a
big hole that needs to be filled.
-evan



It's not quite what you're looking for, but Osaki's Purely
Functional Data Structures might be of interest to you. It
obviously covers data structures, but also operations on the
data structures.



--Chris

References

1. https://github.com/jordanlewis/data.union-find

-- 
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: Interop nightmare

2014-09-08 Thread Michael Klishin
 On 9 September 2014 at 00:33:11, Ivan L (ivan.laza...@gmail.com) wrote:
 For an enterprising clojure hacker, this is a good opportunity  
 to write Clojure for non-Java Hackers and put it up on Pragprog.  

Sounds more like Just enough Java for Clojure. Which I think would have
too small an audience to be worth the effort.
--  
@michaelklishin, github.com/michaelklishin

-- 
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: Books on Functional Algorithms aimed towards undergrad CS?

2014-09-08 Thread Evan Zamir
Thanks, Chris. 

I actually have Okasaki's book and thought to mention it in the post as an 
example of a book that is too advanced for me. Not to mention, it's in ML. 
I'm sure it's a great book, and I could try to slog through it, but it 
would be great to have a more introductory level book on algorithms from a 
functional perspective.

On Monday, September 8, 2014 1:38:28 PM UTC-7, Chris Sims wrote:

 On Mon, Sep 8, 2014, at 10:04 AM, Evan Zamir wrote:

 (First, I should say that I am not an undergrad, haven't been for almost 
 two decades! But in terms of my CS knowledge, that's pretty much where I 
 am.)
  
 I recently started reading Sedgewick's Algorithms book (the red one) and 
 am at least making an attempt to follow along with his Coursera course. As 
 someone who has also been trying to learn Clojure, it struck me that it 
 would be great to have a resource/book on functional versions of all the 
 same algorithms. I know there are Clojure implementations of many, if not 
 all, of the algorithms in the book (for example I found an implementation 
 of union-find https://github.com/jordanlewis/data.union-find on 
 github), but it would be nice to have a self-contained functional version 
 of an Algorithms book.
  
 I guess my question boils down to this. Is there a functional algorithms 
 book aimed at the beginning/intermediate CS undergraduate curriculum? If 
 not, seems to me that would be a big hole that needs to be filled.
 -evan
  
  
 It's not quite what you're looking for, but Osaki's Purely Functional Data 
 Structures might be of interest to you. It obviously covers data 
 structures, but also operations on the data structures.
  
 --Chris
   
  

-- 
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: can't connect with Datomic transactor

2014-09-08 Thread Josh Lehman
Wilker, 

It seems that you haven't actually started the transactor. For developing, 
I'd recommend using lein-datomic 
https://github.com/johnwayner/lein-datomic. 

Hope that helps,
-Josh

On Sunday, September 7, 2014 8:06:55 PM UTC-7, Wilker wrote:

 Hi,

 I was using Datomic in memory for a few days, and now I tried to switch 
 for a more persistent storage. First I tried just using the free, but I was 
 getting this error:

 CompilerException java.lang.NoSuchMethodError: 
 clojure.lang.SeqIterator.init(Lclojure/lang/ISeq;)V, 
 compiling:(form-init5913779045640355531.clj:1:11) 

 Then I tried to use pro to see if that works, but end up with same results.

 The funny part is, if I try to connect just after launching the transactor 
 I get this:

 (def conn (d/connect uri))
 CompilerException clojure.lang.ExceptionInfo: Error communicating with 
 HOST localhost on PORT 4334 {:alt-host nil, :peer-version 2, :password 
 ..., :username ..., :port 4334, :host localhost, :version 0.9.4894, 
 :timestamp 1410145249419, :encrypt-channel true}, 
 compiling:(form-init5913779045640355531.clj:1:11) 

 Then if I run same thing again:

 (def conn (d/connect uri))
 CompilerException java.lang.NoSuchMethodError: 
 clojure.lang.SeqIterator.init(Lclojure/lang/ISeq;)V, 
 compiling:(form-init5913779045640355531.clj:1:11) 

 Running (d/create-database) works just fine (I can confirm by checking on 
 the console).

 All that I get from datomic transactor log is this:

 2014-09-08 00:05:24.455 INFO  defaultdatomic.lifecycle - {:tid 26, 
 :pid 58071, :host localhost, :port 4334, :encrypt-channel true, :version 
 0.9.4894, :timestamp 1410145524454, :event :transactor/heartbeat, :rev 
 198}

 I have no more idea about what to do to fix it... You guys know what this 
 issue is about?

 Thanks.
 ---
 Wilker Lúcio
 http://about.me/wilkerlucio/bio
 Woboinc Consultant
 +55 81 82556600
  

-- 
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: Interop nightmare

2014-09-08 Thread Sam Raker
Thanks for all the help! I knew I could count on you guys.

I saw that there were a bunch of params in the constructor, but naively 
hoped there'd be some kind of default values for them so I didn't have to 
muck around with anything too much. Disappointed once again. I'll look into 
exactly what else I have to move around/import/instantiate before I can get 
the parser to just work.

As for the comments about Clojure being difficult to use w/o knowing Java, 
aside from this unfortunate experience, I've found it pretty easy/not an 
issue. The automatic upgrading of integers to the appropriate underlying 
Java (/JVM) types, and the wrappers around Java's regex stuff are two good 
examples. I'd imagine it'd be much more difficult coming in cold, although 
TJOC and the other intro to Clojure book I read at least covered numerics 
and over/underflow pretty thoroughly. The other stuff (typed arrays, e.g.) 
keep out of your way unless you actively seek them out, so it's not a big 
deal either.

That being said, while Just enough Java for Clojure, as Ivan and Michael 
discussed, might not be big enough on its own for a book/article, I, for 
one, would appreciate more on interop than I've seen, which tends to be 
along the lines of use ClassName/staticThing for static things, use . for 
everything else, also .. and doto exist.

On Monday, September 8, 2014 4:49:12 PM UTC-4, Michael Klishin wrote:

  On 9 September 2014 at 00:33:11, Ivan L (ivan.l...@gmail.com 
 javascript:) wrote: 
  For an enterprising clojure hacker, this is a good opportunity   
  to write Clojure for non-Java Hackers and put it up on Pragprog.   

 Sounds more like Just enough Java for Clojure. Which I think would have 
 too small an audience to be worth the effort. 
 --   
 @michaelklishin, github.com/michaelklishin 


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


Clojure + Vert.x + LightTable

2014-09-08 Thread Paweł Gdula
Hey

Sorry for this noob question, but is there any way to start vert.x project 
for level of LT? 
I have created vert.x project with lein new vertx and it works perfectly 
well from the level of command line, light table screams with:

java.io.FileNotFoundException: Could not locate vertx/core__init.class or 
vertx/core.clj on classpath

Any hint?

Paweł

-- 
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: Books on Functional Algorithms aimed towards undergrad CS?

2014-09-08 Thread Mark Engelberg
Although it's not specifically an algorithms book, the book How to
Design Programs covers a number of important classes of algorithms
(sorting, graph searches, etc.), and more importantly, teaches you how to
reason about them and how to come up with them yourself.

Another great resource is programmingpraxis.com.  If you work through a
significant number of those exercises, you'll gain significant algorithm
expertise.  All the exercises are accompanied by a Scheme solution, which
should be easy to port to Clojure.

Also worth mentioning is a very hard book (harder than Okasaki) called
Pearls of Functional Programming (code is in Haskell).

You can learn a lot by taking any typical algorithms book and try
converting the algorithms to Clojure.  Ask here if you run into problems.

On Mon, Sep 8, 2014 at 2:09 PM, Evan Zamir zamir.e...@gmail.com wrote:

 Thanks, Chris.

 I actually have Okasaki's book and thought to mention it in the post as an
 example of a book that is too advanced for me. Not to mention, it's in ML.
 I'm sure it's a great book, and I could try to slog through it, but it
 would be great to have a more introductory level book on algorithms from a
 functional perspective.


 On Monday, September 8, 2014 1:38:28 PM UTC-7, Chris Sims wrote:

 On Mon, Sep 8, 2014, at 10:04 AM, Evan Zamir wrote:

 (First, I should say that I am not an undergrad, haven't been for almost
 two decades! But in terms of my CS knowledge, that's pretty much where I
 am.)

 I recently started reading Sedgewick's Algorithms book (the red one)
 and am at least making an attempt to follow along with his Coursera course.
 As someone who has also been trying to learn Clojure, it struck me that it
 would be great to have a resource/book on functional versions of all the
 same algorithms. I know there are Clojure implementations of many, if not
 all, of the algorithms in the book (for example I found an implementation
 of union-find https://github.com/jordanlewis/data.union-find on
 github), but it would be nice to have a self-contained functional version
 of an Algorithms book.

 I guess my question boils down to this. Is there a functional algorithms
 book aimed at the beginning/intermediate CS undergraduate curriculum? If
 not, seems to me that would be a big hole that needs to be filled.
 -evan


 It's not quite what you're looking for, but Osaki's Purely Functional
 Data Structures might be of interest to you. It obviously covers data
 structures, but also operations on the data structures.

 --Chris


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


Warnings as errors

2014-09-08 Thread Robert Tweed

Hi list,

Is there a way to get Clojure warnings to act as errors and abort the 
attempted operation? For now, I'm mainly interested in doing this in the 
repl, because I will often do something like this:


  (defn fn [x] (+ 1 x))
  ; WARNING: fn already refers to: #'clojure.core/fn ...

Oops! Did not really want to do that!

In some cases it's possible to unbind accidental bindings but in other 
cases it's either not possible or just doesn't seem to work for me and I 
end up having to restart the repl, which is annoying. I'd rather just 
prevent it happening at all.


In production code I'm not a big fan of warnings either, as with a few 
rare exceptions they correctly indicate that something is wrong, but can 
lead to silent errors instead of fast, noisy failure. That leads to 
things like subtle errors in your persistent data that comes back to 
bite you several months later, far removed from the original error, 
making it very hard to diagnose the root cause of the problem. So again, 
a hard failure mode would be welcome.


- Robert

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

2014-09-08 Thread Ghadi Shayban
If anything let's add more bangs to the name. Unlike any of atom/ref/agent, 
volatile! is not really part of the familiar state model. Yes it applies 
a function to a thing, changing the thing.  Like Luc says, not atomically.

The linux hdparm tool has the –yes-i-know-what-i-am-doing and 
--please-destroy-my-drive flags. Those could be useful.  Maybe (binding 
[*please-randomly-break-my-application* true] ...)

On Monday, September 8, 2014 3:22:48 PM UTC-4, Luc wrote:

 +1 for the ! 

 No atomic changes here, no coordination whatsoever. 

 At the mercy of the caller... 

  I asked Rich and he said making a volatile is as dangerous as any ! 
 op. 
  
  Some people have also asked about vswap! being a macro instead of a 
 method 
  on Volatile. The issue there is that vswap! takes a variadic number of 
  update function args. If implemented as a method, you'd need to provide 
  multiple arities or eventually use apply (like in Atom's swap! 
  
 https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Atom.java#L79)
  

  - doing it in a macro lets that expansion take place at compile time to 
  provide better performance without the apply. 
  
  
  
  
  
  On Mon, Sep 8, 2014 at 1:36 PM, Jozef Wagner jozef@gmail.com 
 javascript: wrote: 
  
   FYI the ticket about volatile is at 
   http://dev.clojure.org/jira/browse/CLJ-1512 and the same question was 
   raised there. 
   
   On Mon, Sep 8, 2014 at 4:25 PM, Frantisek Sodomka fsod...@gmail.com 
 javascript: 
   wrote: 
Hello, 
I posted a question about volatiles on the github commit: 

   
 https://github.com/clojure/clojure/commit/60440977823752f13a3fec3637538e9a1d68c5d4
  

I don't know if anybody noticed, so... why is volatile created with 
   function 
volatile! and not volatile ? Atoms, refs and agents don't have 
exclamation mark in their constructor functions. 

Should I think about volatiles as mutable locals?  :-) 

František 


On Friday, September 5, 2014 4:26:53 PM UTC+2, Alex Miller wrote: 

Clojure 1.7.0-alpha1 is now available. 

Try it via 
- Download: 
http://central.maven.org/maven2/org/clojure/clojure/1.7.0-alpha2/ 
- Download securely: 
https://repo1.maven.org/maven2/org/clojure/clojure/1.7.0-alpha2/ 
- Leiningen: [org.clojure/clojure 1.7.0-alpha2] 

Highlights below, full change log here: 
https://github.com/clojure/clojure/blob/master/changes.md 

For users of Clojure 1.7.0-alpha1, there have been a few important 
   changes 
in transducers since alpha1: 
- Removed flatmap transducer 
- Added cat transducer 
- mapcat 1-arity is now a transducer, specifically: (comp (map f) 
 cat) 
- The completing function has been lifted to be public 

Clojure 1.7.0-alpha2 has the changes below from 1.6.0: 

## 1 New and Improved Features 

### 1.1 Transducers 

Transducers is a new way to decouple algorithmic transformations 
 from 
their 
application in different contexts. Transducers are functions that 
transform 
reducing functions to build up a recipe for transformation. 

Also see: 
   http://blog.cognitect.com/blog/2014/8/6/transducers-are-coming 

Many existing sequence functions now have a new arity (one fewer 
   argument 
than before). This arity will return a transducer that represents 
 the 
   same 
logic but is independent of lazy sequence processing. Functions 
 included 
are: 

* conj (conjs to []) 
* map 
* mapcat 
* filter 
* remove 
* take 
* take-while 
* drop 
* drop-while 
* cycle 
* take-nth 
* replace 
* partition-by 
* partition-all 
* keep 
* keep-indexed 

Additionally some new transducer functions have been added: 

* cat - concatenates the contents of each input 
* de-dupe - removes consecutive duplicated values 
* random-sample - returns items from coll with random probability 

And this function can be used to make completing transforms: 

* completing 

There are also several new or modified functions that can be used 
 to 
   apply 
transducers in different ways: 

* sequence - takes a transformation and a coll and produces a lazy 
 seq 
* transduce - reduce with a transformation (eager) 
* iteration - returns an iterable/seqable/reducible seq of 
 applications 
   of 
the transducer to items in coll. Applications are re-performed with 
   every 
iterator/seq/reduce. 
* run! - run the transformation for side effects on the collection 

There have been a number of internal changes to support 
 transducers: 

* volatiles - there are a new set of functions (volatile!, vswap!, 
vreset!, volatile?) to create and use volatile boxes to hold 
 state in 
stateful transducers. Volatiles are faster than atoms but give up 
   atomicity 

Re: Interop nightmare

2014-09-08 Thread Lee Spector

On Sep 8, 2014, at 4:48 PM, Michael Klishin michael.s.klis...@gmail.com wrote:
 Sounds more like Just enough Java for Clojure. Which I think would have
 too small an audience to be worth the effort.

I'd buy it for sure. I bet that some of my students would too.

 -Lee

-- 
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: Interop nightmare

2014-09-08 Thread Alan Busby
On Tue, Sep 9, 2014 at 3:09 AM, Sean Corfield s...@corfield.org wrote:

  I find that it is quite difficult to use clojure unless one knows Java,
 which I believe to be a barrier to new comers.

 I'm surprised every time I hear this. You can write a lot of Clojure
 without having to do any interop so you can mostly ignore Java altogether
 unless you specifically want to work with a Java library.


I don't think any of my Clojure books mention how to convert a string to a
numeric, which is missing in Clojure and hence requires Java interop.
That's just one example of a fairly basic thing that would be a barrier to
new comers.

-- 
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: Interop nightmare

2014-09-08 Thread Lee Spector

On Sep 8, 2014, at 9:09 PM, Alan Busby thebu...@gmail.com wrote:

 On Tue, Sep 9, 2014 at 3:09 AM, Sean Corfield s...@corfield.org wrote:
  I find that it is quite difficult to use clojure unless one knows Java, 
  which I believe to be a barrier to new comers.
 
 I'm surprised every time I hear this. You can write a lot of Clojure without 
 having to do any interop so you can mostly ignore Java altogether unless you 
 specifically want to work with a Java library.
 
 I don't think any of my Clojure books mention how to convert a string to a 
 numeric, which is missing in Clojure and hence requires Java interop. That's 
 just one example of a fairly basic thing that would be a barrier to new 
 comers.

Do you mean this?:

= (read-string 1.23)
1.23

I manage to get by with very little Java interop, but I'd love to have more 
guidance for doing it when I need it.

 -Lee

-- 
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] aprint (awesome print) released

2014-09-08 Thread bob

Cool

On Friday, September 5, 2014 5:50:10 AM UTC+8, Vladimir Bokov wrote:

 Hi folks, I got just tired to gazing into big amount of data and scroll 
 3-4 screens of my 13' laptop to grasp the structure,
 so I used pprint's pretty printer, but add colors and changed indentation 
 *by default*
 (actually pprint has tuning parameters, too, but anyway it's breaking maps 
 by single entry by line...)

 Now the screen area gets used more effectively and looks more friendly imo 
 :)
 See it: https://github.com/razum2um/aprint

 Looking forward yours opinion if I should make a nrepl middleware to use 
 it *right away*, without doing (ap)
 every 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: can't connect with Datomic transactor

2014-09-08 Thread Wilker
Hi Josh,

I know that I have the transactor running, creating databases works, just
connecting that doesn't...

I tried your solution, but I'm still getting the same error, I would like
to know at least maybe a better way to debug it, the major issue is that
the error messages doesn't give any clue about what's wrong... I really
believe that's something with my env, but it's being really hard to track
down what it is.

---
Wilker Lúcio
http://about.me/wilkerlucio/bio
Woboinc Consultant
+55 81 82556600


On Mon, Sep 8, 2014 at 6:13 PM, Josh Lehman jalehma...@gmail.com wrote:

 Wilker,

 It seems that you haven't actually started the transactor. For developing,
 I'd recommend using lein-datomic
 https://github.com/johnwayner/lein-datomic.

 Hope that helps,
 -Josh


 On Sunday, September 7, 2014 8:06:55 PM UTC-7, Wilker wrote:

 Hi,

 I was using Datomic in memory for a few days, and now I tried to switch
 for a more persistent storage. First I tried just using the free, but I was
 getting this error:

 CompilerException java.lang.NoSuchMethodError: 
 clojure.lang.SeqIterator.init(Lclojure/lang/ISeq;)V,
 compiling:(form-init5913779045640355531.clj:1:11)

 Then I tried to use pro to see if that works, but end up with same
 results.

 The funny part is, if I try to connect just after launching the
 transactor I get this:

 (def conn (d/connect uri))
 CompilerException clojure.lang.ExceptionInfo: Error communicating with
 HOST localhost on PORT 4334 {:alt-host nil, :peer-version 2, :password
 ..., :username ..., :port 4334, :host localhost, :version 0.9.4894,
 :timestamp 1410145249419, :encrypt-channel true}, compiling:(form-
 init5913779045640355531.clj:1:11)

 Then if I run same thing again:

 (def conn (d/connect uri))
 CompilerException java.lang.NoSuchMethodError: 
 clojure.lang.SeqIterator.init(Lclojure/lang/ISeq;)V,
 compiling:(form-init5913779045640355531.clj:1:11)

 Running (d/create-database) works just fine (I can confirm by checking on
 the console).

 All that I get from datomic transactor log is this:

 2014-09-08 00:05:24.455 INFO  defaultdatomic.lifecycle - {:tid 26,
 :pid 58071, :host localhost, :port 4334, :encrypt-channel true, :version
 0.9.4894, :timestamp 1410145524454, :event :transactor/heartbeat, :rev
 198}

 I have no more idea about what to do to fix it... You guys know what this
 issue is about?

 Thanks.
 ---
 Wilker Lúcio
 http://about.me/wilkerlucio/bio
 Woboinc Consultant
 +55 81 82556600

  --
 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: can't connect with Datomic transactor

2014-09-08 Thread Wilker
Actually, I just got an answer on the Datomic list, the problem is that I'm
using Clojure 1.7.0-alpha2.

So, just have to wait for a new version now.

---
Wilker Lúcio
http://about.me/wilkerlucio/bio
Woboinc Consultant
+55 81 82556600


On Tue, Sep 9, 2014 at 1:12 AM, Wilker wilkerlu...@gmail.com wrote:

 Hi Josh,

 I know that I have the transactor running, creating databases works, just
 connecting that doesn't...

 I tried your solution, but I'm still getting the same error, I would like
 to know at least maybe a better way to debug it, the major issue is that
 the error messages doesn't give any clue about what's wrong... I really
 believe that's something with my env, but it's being really hard to track
 down what it is.

 ---
 Wilker Lúcio
 http://about.me/wilkerlucio/bio
 Woboinc Consultant
 +55 81 82556600


 On Mon, Sep 8, 2014 at 6:13 PM, Josh Lehman jalehma...@gmail.com wrote:

 Wilker,

 It seems that you haven't actually started the transactor. For
 developing, I'd recommend using lein-datomic
 https://github.com/johnwayner/lein-datomic.

 Hope that helps,
 -Josh


 On Sunday, September 7, 2014 8:06:55 PM UTC-7, Wilker wrote:

 Hi,

 I was using Datomic in memory for a few days, and now I tried to switch
 for a more persistent storage. First I tried just using the free, but I was
 getting this error:

 CompilerException java.lang.NoSuchMethodError: 
 clojure.lang.SeqIterator.init(Lclojure/lang/ISeq;)V,
 compiling:(form-init5913779045640355531.clj:1:11)

 Then I tried to use pro to see if that works, but end up with same
 results.

 The funny part is, if I try to connect just after launching the
 transactor I get this:

 (def conn (d/connect uri))
 CompilerException clojure.lang.ExceptionInfo: Error communicating with
 HOST localhost on PORT 4334 {:alt-host nil, :peer-version 2, :password
 ..., :username ..., :port 4334, :host localhost, :version 0.9.4894,
 :timestamp 1410145249419, :encrypt-channel true}, compiling:(form-
 init5913779045640355531.clj:1:11)

 Then if I run same thing again:

 (def conn (d/connect uri))
 CompilerException java.lang.NoSuchMethodError: 
 clojure.lang.SeqIterator.init(Lclojure/lang/ISeq;)V,
 compiling:(form-init5913779045640355531.clj:1:11)

 Running (d/create-database) works just fine (I can confirm by checking
 on the console).

 All that I get from datomic transactor log is this:

 2014-09-08 00:05:24.455 INFO  defaultdatomic.lifecycle - {:tid 26,
 :pid 58071, :host localhost, :port 4334, :encrypt-channel true, :version
 0.9.4894, :timestamp 1410145524454, :event :transactor/heartbeat, :rev
 198}

 I have no more idea about what to do to fix it... You guys know what
 this issue is about?

 Thanks.
 ---
 Wilker Lúcio
 http://about.me/wilkerlucio/bio
 Woboinc Consultant
 +55 81 82556600

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