Re: Change components of JPanel autonomously and simultaneously

2012-01-31 Thread Dave Ray
> ;; This is how I repaint the frame, after changing the list
> (doto *frame*
>       (.setContentPane (make-panel))
>       .repaint
>       (.setVisible true))
>

This is probably the reason it's slow (you don't say how many rects
you're drawing). It's only necessary to set the content pane of the
frame and set it visible once. After that, you should call repaint on
*just the panel*:

  (.repaint panel)

You can use add-watch on your list to call this automatically whenever
the ref changes.

If, for some reason, this is still too slow, you can use a more
explicit version of repaint [1] which requests that only a specific
area of the panel be repainted.

Hope this helps,

Dave

[1] 
http://docs.oracle.com/javase/6/docs/api/javax/swing/JComponent.html#repaint(long,%20int,%20int,%20int,%20int)

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


Re: Change components of JPanel autonomously and simultaneously

2012-01-31 Thread Jonathan Cardoso
Thank's, I will try to adapt my code to use watch (I didn't know this 
feature and found it really interesting!).

The problem with JPanel repaint is that, I don't surely know why but the 
JFrame doesn't "understands" it when I change and has an awkward behavior: 
if I click on the button that makes the changes in the JPanel, the frame 
doesn't change until I minimize it and open again. =S

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

Re: Change components of JPanel autonomously and simultaneously

2012-01-31 Thread Jonathan Cardoso
I used   (SwingUtilities/updateComponentTreeUI *frame*), worked great and 
seems faster even without using watch yet.

Thank's

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

On section 11.2.1 of /The Joy of Clojure/

2012-01-31 Thread Guanpeng Xu
Hi all,

In section 11.2.1 of the book /The Joy of Clojure/, the author shows
the effect of
`dosync' by starting 100 threads and then watching the value of a Ref:

  (go make-move 100 100)
  (board-map #(dosync (deref %)) board)

Here, the first `go' form starts 100 threads, their effect is
modifying `board' using
`dosync' and `alter'.  `board-map' is defined as

  (defn board-map [f bd]
(vec (map #(vec (for [s %] (f s))) bd)))

I don't quite understand the use of `dosync' in the second `board-map'
form.  In
my testing, the following three seems identical:

  (board-map #(dosync (deref %) board)
  (dosync (board-map deref board))  ;; Should be the same as above
  (board-map deref board)  ;; Without `dosync' at all

The docstring of `deref' says "Within a transaction, returns the in-
transaction-value
of ref, else returns the most-recently-committed value of ref."  So
the above three
forms are all the same, right?  Or is there any difference between
them?

Thanks in advance,
Guanpeng Xu

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


Re: On section 11.2.1 of /The Joy of Clojure/

2012-01-31 Thread Herbert Euler
Hmm, I didn't read the definition of `board-map' carefully.  It seems the
second form

   (dosync (board-map deref board))

is the best among the three, as it views `board' as a whole.  The other two
might have the potential problem of printing incoordinated values of
entries in `board', i.e. the entries of `board' might change during the
iteration in the `map' form. Am I right?

Thanks,
Guanpeng Xu

On Tue, Jan 31, 2012 at 11:46 AM, Guanpeng Xu wrote:

> Hi all,
>
> In section 11.2.1 of the book /The Joy of Clojure/, the author shows
> the effect of
> `dosync' by starting 100 threads and then watching the value of a Ref:
>
>  (go make-move 100 100)
>  (board-map #(dosync (deref %)) board)
>
> Here, the first `go' form starts 100 threads, their effect is
> modifying `board' using
> `dosync' and `alter'.  `board-map' is defined as
>
>  (defn board-map [f bd]
>(vec (map #(vec (for [s %] (f s))) bd)))
>
> I don't quite understand the use of `dosync' in the second `board-map'
> form.  In
> my testing, the following three seems identical:
>
>  (board-map #(dosync (deref %) board)
>  (dosync (board-map deref board))  ;; Should be the same as above
>  (board-map deref board)  ;; Without `dosync' at all
>
> The docstring of `deref' says "Within a transaction, returns the in-
> transaction-value
> of ref, else returns the most-recently-committed value of ref."  So
> the above three
> forms are all the same, right?  Or is there any difference between
> them?
>
> Thanks in advance,
> Guanpeng Xu

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

Re: On section 11.2.1 of /The Joy of Clojure/

2012-01-31 Thread Herbert Euler
I think I'm right.  This is a program that demonstrates what I was thinking
o:

;; Program begins.

(defn traverse [f dat]
  (vec (map #(f %) dat)))

(def data (traverse ref (take 10 (iterate inc 0

(-> (fn []
  (dosync (loop [i 0
 data data]
(when (seq data)
  (Thread/sleep 1000)
  (println (str ">>> " i ": " @(first data)))
  (recur (+ i 1) (next data))
Thread.
.start)

(Thread/sleep 1500)
(dosync
 (traverse (fn [ref]
 (alter ref inc))
   data))

(Thread/sleep 1000)
;; This one extra sleep forces the "main" thread sleeping for one
;; second.  Due to some reason I don't know for now, when `dosync'
;; retries, the first sleep will be interrupted.
(Thread/sleep 1000)
(dosync
 (traverse (fn [ref]
 (alter ref inc))
   data))

(traverse #(println (str "--- " @%)) data)

;; Program ends here.

The result is

>>> 0: 0
>>> 0: 1
--- 2
--- 3
--- 4
--- 5
--- 6
--- 7
--- 8
--- 9
--- 10
--- 11
>>> 1: 2
>>> 0: 2
>>> 1: 3
>>> 2: 4
>>> 3: 5
>>> 4: 6
>>> 5: 7
>>> 6: 8
>>> 7: 9
>>> 8: 10
>>> 9: 11

Meaning the `dosync' form in the thread is retried twice, due to the two
passes of changing of the values in `data'.  So using `dosync' to surround
the whole data structure is the best way to go.

Best regards,
Guanpeng Xu

On Tue, Jan 31, 2012 at 12:00 PM, Herbert Euler wrote:

> Hmm, I didn't read the definition of `board-map' carefully.  It seems the
> second form
>
>(dosync (board-map deref board))
>
> is the best among the three, as it views `board' as a whole.  The other
> two might have the potential problem of printing incoordinated values of
> entries in `board', i.e. the entries of `board' might change during the
> iteration in the `map' form. Am I right?
>
> Thanks,
> Guanpeng Xu
>
> On Tue, Jan 31, 2012 at 11:46 AM, Guanpeng Xu wrote:
>
>> Hi all,
>>
>> In section 11.2.1 of the book /The Joy of Clojure/, the author shows
>> the effect of
>> `dosync' by starting 100 threads and then watching the value of a Ref:
>>
>>  (go make-move 100 100)
>>  (board-map #(dosync (deref %)) board)
>>
>> Here, the first `go' form starts 100 threads, their effect is
>> modifying `board' using
>> `dosync' and `alter'.  `board-map' is defined as
>>
>>  (defn board-map [f bd]
>>(vec (map #(vec (for [s %] (f s))) bd)))
>>
>> I don't quite understand the use of `dosync' in the second `board-map'
>> form.  In
>> my testing, the following three seems identical:
>>
>>  (board-map #(dosync (deref %) board)
>>  (dosync (board-map deref board))  ;; Should be the same as above
>>  (board-map deref board)  ;; Without `dosync' at all
>>
>> The docstring of `deref' says "Within a transaction, returns the in-
>> transaction-value
>> of ref, else returns the most-recently-committed value of ref."  So
>> the above three
>> forms are all the same, right?  Or is there any difference between
>> them?
>>
>> Thanks in advance,
>> Guanpeng Xu
>
>
>

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

Contrib for Clojure 1.3

2012-01-31 Thread kohyama
Dear Sirs and Madams

I'm going to use clojure 1.3.
What should we do, when we're trying to do things like we've been doing 
with clojure 1.2 and contrib 1.2?
Such as things with contrib.io, contrib.duck-stream, contrib.string.

For example, to get lines in a file as a list of strings and do some 
modification for each line,
I've been doing:
(map
  *some-modification*
  (clojure.contrib.duck-streams/read-lines  "*a-path-name*"))
.

1) Use other functions using *in* in clojure 1.3, with binding *in* to a 
file reader.
2) Use the contrib1.2 compiled for clojure 1.3.
3) Use other libraries derived from contrib 1.2.

When we're trying to port large sources of clojure 1.2 for clojure 1.3, I 
guess we should take 2).
But I want to know what should we do with new developments after now.

Best regards,
Yoshinori Kohyama (@kohyama )

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

Re: Contrib for Clojure 1.3

2012-01-31 Thread Baishampayan Ghose
Yoshinori,

> I'm going to use clojure 1.3.
> What should we do, when we're trying to do things like we've been doing with
> clojure 1.2 and contrib 1.2?
> Such as things with contrib.io, contrib.duck-stream, contrib.string.
>
> For example, to get lines in a file as a list of strings and do some
> modification for each line,
> I've been doing:
> (map
>   some-modification
>   (clojure.contrib.duck-streams/read-lines  "a-path-name"))
> .
>
> 1) Use other functions using *in* in clojure 1.3, with binding *in* to a
> file reader.
> 2) Use the contrib1.2 compiled for clojure 1.3.
> 3) Use other libraries derived from contrib 1.2.
>
> When we're trying to port large sources of clojure 1.2 for clojure 1.3, I
> guess we should take 2).
> But I want to know what should we do with new developments after now.

As you might know, the monolithic clojure contrib from 1.2 got split
into many independent
contrib projects. The changes are quite well documented here -

http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
http://dev.clojure.org/display/doc/Clojure+Contrib

To replace clojure.contrib.duck-streams, you might need to take a look
at clojure.java.io which is now in clojure core itself.

Regards,
BG

-- 
Baishampayan Ghose
b.ghose at gmail.com

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


Re: Change components of JPanel autonomously and simultaneously

2012-01-31 Thread Dave Ray
Calling repaint directly on the panel (not the frame) should be all
that's necessary to update the display. updateComponentTreeUI() is
only used when the look and feel of an app changes.

Dave

On Tue, Jan 31, 2012 at 8:44 AM, Jonathan Cardoso
 wrote:
> I used   (SwingUtilities/updateComponentTreeUI *frame*), worked great and
> seems faster even without using watch yet.
>
> Thank's
>
> --
> 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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: New Version of ClojureScript One

2012-01-31 Thread Craig Andera
> This is a problem with the current version of Leiningen. There are a
> couple of ways to work around the problem. Here is one:
>
> Create a new Leiningen project.
>
> lein new delete-me
> cd delete-me
>
> Open project.clj and change
>
> :dependencies [[org.clojure/clojure "1.3.0"]]
>
> to
>
> :dependencies [[org.clojure/clojure "1.2.1"]]
>
> Save this file and then run
>
> lein deps
>
> You can now delete this project. The whole point was to get
> clojure-1.2.1 into your local maven repository. lein should now work
> in ClojureScript One and with any other Clojure 1.3 projects.

I just ran into this myself. I think a slightly more convenient fix is to run

lein install org.clojure/clojure "1.2.1"

In any event, that did it for me. I'll try to get the wiki and website
updated so people can be aware of the workaround.

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


EuroClojure 2012: CfP open

2012-01-31 Thread Marco Abis
Hi all,

   after quite some time working on this I'm excited to announce
"the first 2-day, full-blown conference in Europe for the Clojure
community" to be held in London (England) on May 24-25. The conference
will be preceded by a 3-day training class delivered by the good guys
from Relevance :-)

The Call for Presentations is now open, all the details and the form
here: http://euroclojure.com/2012/call-for-presentations/

Looking forward to it, for any info please do not hesitate to contact me

Regards

-- 
Marco Abis

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


[ANN] clj-http 0.3.0 released

2012-01-31 Thread Lee Hinman
Hi all,

I'm pleased to announce the 0.3.0 release of clj-http. clj-http is an
idiomatic clojure http client wrapping the apache client (like ring in
reverse). You should be able to use it from Clojars[1] with the
following:

[clj-http "0.3.0"]

New features and bug-fixes:

- Added the ability to ignore unknown host if desired
- Use much better Entity’s for the body, depending on type, removing
extraneous :body copies
- Fixed url-encoding of multiple query params using the same key
- Fixed decoding cookies that don’t follow RFC spec
- Better output coercion, adding {:as ""},
{:as :json}, {:as :json-string-keys} and {:as :auto}
- Better input coercion, supporting bodies as Strings, InputStreams,
Files and byte-arrays
- Less reflection

Please give it a try and open any issues on the github repo[2] that
you find. Check out the readme for the full information and usage.

thanks,
Lee Hinman

[1]: http://clojars.org/clj-http
[2]: https://github.com/dakrone/clj-http

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


Re: [ANN] clj-http 0.3.0 released

2012-01-31 Thread Baishampayan Ghose
Yay!

Regards,
BG

---
Sent from phone, please excuse brevity.
On Feb 1, 2012 12:01 AM, "Lee Hinman"  wrote:

> Hi all,
>
> I'm pleased to announce the 0.3.0 release of clj-http. clj-http is an
> idiomatic clojure http client wrapping the apache client (like ring in
> reverse). You should be able to use it from Clojars[1] with the
> following:
>
> [clj-http "0.3.0"]
>
> New features and bug-fixes:
>
> - Added the ability to ignore unknown host if desired
> - Use much better Entity’s for the body, depending on type, removing
> extraneous :body copies
> - Fixed url-encoding of multiple query params using the same key
> - Fixed decoding cookies that don’t follow RFC spec
> - Better output coercion, adding {:as ""},
> {:as :json}, {:as :json-string-keys} and {:as :auto}
> - Better input coercion, supporting bodies as Strings, InputStreams,
> Files and byte-arrays
> - Less reflection
>
> Please give it a try and open any issues on the github repo[2] that
> you find. Check out the readme for the full information and usage.
>
> thanks,
> Lee Hinman
>
> [1]: http://clojars.org/clj-http
> [2]: https://github.com/dakrone/clj-http
>
> --
> 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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: ForkJoin updates

2012-01-31 Thread Alex Miller
I think the suggestion from the OP is to change the computational
executor pool in Agent from an Executors to a ForkJoinPool to get
better scalability.  Indeed, the work Doug has been in doing is in
response to many libs using fork/join as an alternative to Executors
to schedule lightweight computational tasks, GPars in Groovy and Scala
actors being the obvious examples.  We're using fork/join similarly in
our processing engine at Revelytix (in Clojure).

The benefit of using fork/join in this scenario is to eliminate the
possible bottleneck of a single entry queue for all agent task
executions, which is an inherent part of using Executors.  On chunkier
tasks or smaller core counts (the original design space for
Executors), this is not an issue, but I believe the pool under agent
send (but probably not send-off) would be a good match.  The pool
under send-off (and future) is probably not as good for this as it is
assumed to be IO-bound and may block, which fork/join does not
generally like.  We have used the fork/join ManagedBlocker api to get
around this in some cases though.

If someone wanted to work on it, the changes seem isolated to
Agent.java so this is a very tractable problem.

I think that David Liebke's f/j work has largely been to look at using
f/j for parallel execution over data structures ala pmap, which is an
entirely different problem (but also one of great interest).


On Jan 29, 7:34 pm, Stuart Sierra  wrote:
> There was some excellent work on ForkJoin in Clojure by David Liebke and
> others last year, but it never made it into the main Clojure branch. It's
> waiting for someone else to finish it. Search the wiki and mailing list for
> notes.
>
> -S

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


Re: Contrib for Clojure 1.3

2012-01-31 Thread Mark Engelberg
On Tue, Jan 31, 2012 at 6:18 AM, Baishampayan Ghose  wrote:
> As you might know, the monolithic clojure contrib from 1.2 got split
> into many independent
> contrib projects. The changes are quite well documented here -

I  know there's some documentation about the migration out there, but
I do sympathize with the original poster -- it can still be
surprisingly difficult to figure out exactly what lines to put in the
lein project file to make the new contrib modules work.  I was
involved in porting a few libraries to 1.3, and I still find it
confusing.

I think that here on the list, some people have posted some good
information about how to figure out exactly what repository and
version number information are needed in the project file; it would be
great to see that put in a highly visible, public place.

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


Re: EuroClojure 2012: CfP open

2012-01-31 Thread Edmund
On 31/01/2012 17:07, Marco Abis wrote:
> Hi all,
> 
> after quite some time working on this I'm excited to announce "the
> first 2-day, full-blown conference in Europe for the Clojure 
> community" to be held in London (England) on May 24-25. The
> conference will be preceded by a 3-day training class delivered by
> the good guys from Relevance :-)
> 
> The Call for Presentations is now open, all the details and the
> form here: http://euroclojure.com/2012/call-for-presentations/
> 
> Looking forward to it, for any info please do not hesitate to
> contact me
> 
> Regards
> 

Magic !

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


[ANN]: cljsh & repls 1.6.0 - so many repls, so little time…

2012-01-31 Thread Frank Siebenlist
We already have swank, lein repl, cake, nrepl, detour, clj, reply, … and now we 
have the combo "cljsh & repls".

"repls" is a lein plugin, which is essentially leiningen's native "lein repl" 
task with some default config options for the (not-)printing of eval results 
and repl-prompt. It gives you a persistent repl-server that uses the basic 
repl-protocol: clj-code as text for the reader thru stdin, and evaluated 
results and printed side-effects thru stdout. Install it with "lein plugin 
install lein-repls 1.6.0", and run the repl-server in your project directory 
with "lein repls", and just leave it running...

"cljsh" is a "clojure shell" bash-script that uses "socat" under the covers to 
make the repl-server's stdin and stdout appear local to cljsh. It allows for a 
relatively simple sending of clj-statements and clj-files to the persistent 
repl-server. cljsh is also very lightweight, like cake/nailgun, with a 
negligible startup time, which makes the evaluation of much of your clj-code 
almost instant. You run cljsh like a normal shell script, like bash or sed, and 
pass clj-code statements and files as command line directives or piped-in thru 
stdin. That code is sent to the persistent repl-server, and the printed results 
and output are available on cljsh's stdout. Almost sounds too simple… Download 
the cljsh script from github: 
"https://raw.github.com/franks42/lein-repls/master/bin/cljsh.sh"; and put it 
somewhere in your path. An example command line invocation looks like:

  $ cljsh -c '(println "hello")'  
  hello  
  $  

or a more contrived example:

  $ cat third.clj | cljsh -c '(println "first")' -i second.clj - fourth.clj 
-myargs

The cljsh-test.sh script shows most of the supported features: 
"https://github.com/franks42/lein-repls/blob/master/bin/cljsh-test.sh";.

cljsh also supports an interactive repl-mode with history and completion 
support thru rlwrap - pretty much like the other repls, except that this one 
starts-up instantly, and you can have multiple, concurrent repl-sessions 
working with the same persistent repl-server. (not sure why you would do that… 
but you can/could… ;-)). The completion words can easily be updated with cljsh 
to reflect the evaluation context, but remember that rlwrap is a poor-man's 
completion solution… even though it works pretty well most of the time.

Possible usage scenarios.
Easy to write cljsh-scripts that can be used to select code in any text editor 
or any app and send for evaluation. Select any symbol in any app/browser and 
lookup the doc. Use growl notification to show you the doc or the stack trace 
or eval result. Write your clj-based unix filter. Browse the filesystem with fs 
by changing the repl-prompt to reflect your cwd. Write your clj-based macosx 
automation service. Please let me know if you come up with any others…

Even though it all seems to work pretty well on my macosx… your mileage may 
vary on the other unixes, and it most probably won't work on windows… maybe 
cygwin(?). Please let me know of any compatibilty issues.

Next step: extend it to support clojurescript. (…driving a browser UI thru 
unix-style filters and scripts from the command line…)

Please take a look at the README at: "https://github.com/franks42/lein-repls"; 
for details.
Any feedback is very much appreciated.

Enjoy, FrankS.



 

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


Re: Contrib for Clojure 1.3

2012-01-31 Thread Base
+1 Mark.

On Jan 31, 1:59 pm, Mark Engelberg  wrote:
> On Tue, Jan 31, 2012 at 6:18 AM, Baishampayan Ghose  wrote:
> > As you might know, the monolithic clojure contrib from 1.2 got split
> > into many independent
> > contrib projects. The changes are quite well documented here -
>
> I  know there's some documentation about the migration out there, but
> I do sympathize with the original poster -- it can still be
> surprisingly difficult to figure out exactly what lines to put in the
> lein project file to make the new contrib modules work.  I was
> involved in porting a few libraries to 1.3, and I still find it
> confusing.
>
> I think that here on the list, some people have posted some good
> information about how to figure out exactly what repository and
> version number information are needed in the project file; it would be
> great to see that put in a highly visible, public place.

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


Re: Contrib for Clojure 1.3

2012-01-31 Thread cej38
+1 Mark.

One of the things that was really nice about clojure.contrib up
through 1.2 was the unified API documentation.  I would also like to
see that come back.




On Jan 31, 4:06 pm, Base  wrote:
> +1 Mark.
>
> On Jan 31, 1:59 pm, Mark Engelberg  wrote:
>
>
>
>
>
>
>
> > On Tue, Jan 31, 2012 at 6:18 AM, Baishampayan Ghose  
> > wrote:
> > > As you might know, the monolithic clojure contrib from 1.2 got split
> > > into many independent
> > > contrib projects. The changes are quite well documented here -
>
> > I  know there's some documentation about the migration out there, but
> > I do sympathize with the original poster -- it can still be
> > surprisingly difficult to figure out exactly what lines to put in the
> > lein project file to make the new contrib modules work.  I was
> > involved in porting a few libraries to 1.3, and I still find it
> > confusing.
>
> > I think that here on the list, some people have posted some good
> > information about how to figure out exactly what repository and
> > version number information are needed in the project file; it would be
> > great to see that put in a highly visible, public place.

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


Unable to bootstrap ClojureScript

2012-01-31 Thread HB
Hi,
Would you please have a look at this thread:
http://stackoverflow.com/questions/9087817/unable-to-bootstrap-clojurescript
Thanks for help and 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


group-by by multiple keys

2012-01-31 Thread ron peterson
hello,

How to group a collection of maps by multiple keys?

For example

(def m1 [{:a 1 :b 2 :c 3}{:a 1 :b 2 :c 4}{:a 1 :b 4 :c 3}{:a 1 :b 4 :c
3}])

(group-by-x [:a :b] m1)

I'd it like to return this:

[{:a 1 :b 2}[{:a 1 :b 2 :c 3}{:a 1 :b 2 :c 4}], {:a 1 :b 4}[{:a 1 :b
4 :c 3}{:a 1 :b 4 :c 3}]]

Thanks. R.

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


Re: Contrib for Clojure 1.3

2012-01-31 Thread Sun Ning
As the wiki says, there is an unofficial branch of contrib compiled 
against 1.3


https://github.com/arohner/clojure-contrib/tree/1.3-compat

On 01/31/2012 09:22 AM, kohyama wrote:

Dear Sirs and Madams

I'm going to use clojure 1.3.
What should we do, when we're trying to do things like we've been 
doing with clojure 1.2 and contrib 1.2?

Such as things with contrib.io, contrib.duck-stream, contrib.string.

For example, to get lines in a file as a list of strings and do some 
modification for each line,

I've been doing:
(map
/some-modification/
  (clojure.contrib.duck-streams/read-lines  "/a-path-name/"))
.

1) Use other functions using *in* in clojure 1.3, with binding *in* to 
a file reader.

2) Use the contrib1.2 compiled for clojure 1.3.
3) Use other libraries derived from contrib 1.2.

When we're trying to port large sources of clojure 1.2 for clojure 
1.3, I guess we should take 2).

But I want to know what should we do with new developments after now.

Best regards,
Yoshinori Kohyama (@kohyama )
--
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 


--
Sun Ning
Software developer
Nanjing, China (N32°3'42'' E118°46'40'')
http://about.me/sunng/bio

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


Re: problems with meta

2012-01-31 Thread raschedh
> Hope that helps.

It did. Thanks a lot ! Your explanation made it perfectly clear,
what I was missing.
I didn't know that I was able to do something like

(def ^{:m 1} ^:dynamic *x* ^{:m 1} ^{:n 1} [])

That is useful to me.

And thank you for pointing out the relevant part of the LispReader
to me. I am looking forward to dig into the source for quite a while
now, and so that represented a good opportunity for that.

Die Gelegenheit beim Schopf ergreifend, auch ein herzliches
Dankeschoen fuer vimclojure, dessen Nutzer ich bin.

Heinz.

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


Re: Contrib for Clojure 1.3

2012-01-31 Thread kohyama
Baishampayan,

Thank you for your informatioin.
The page "Where Did Clojure.Contrib Go" tells me much.
O.K. Now I see that what we should do is depend on the namespace in contrib 
1.2.

Thank you again.

Best regards,

Yoshinori Kohyama (@kohyama )


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

Re: group-by by multiple keys

2012-01-31 Thread Cedric Greevey
On Tue, Jan 31, 2012 at 7:41 PM, ron peterson  wrote:
> hello,
>
> How to group a collection of maps by multiple keys?
>
> For example
>
> (def m1 [{:a 1 :b 2 :c 3}{:a 1 :b 2 :c 4}{:a 1 :b 4 :c 3}{:a 1 :b 4 :c
> 3}])
>
> (group-by-x [:a :b] m1)
>
> I'd it like to return this:
>
> [{:a 1 :b 2}[{:a 1 :b 2 :c 3}{:a 1 :b 2 :c 4}], {:a 1 :b 4}[{:a 1 :b
> 4 :c 3}{:a 1 :b 4 :c 3}]]
>
> Thanks. R.

(group-by #(select-keys % [:a :b]) m1)

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


Re: group-by by multiple keys

2012-01-31 Thread Jay Fields
user=> (def m1 [{:a 1 :b 2 :c 3}{:a 1 :b 2 :c 4}{:a 1 :b 4 :c 3}{:a 1 :b 4 :c
3}])
#'user/m1
user=> (require 'clojure.set)
nil
user=> (doc clojure.set/index)
-
clojure.set/index
([xrel ks])
  Returns a map of the distinct values of ks in the xrel mapped to a
  set of the maps in xrel with the corresponding values of ks.
nil
user=> (clojure.set/index m1 [:a :b])
{{:b 4, :a 1} #{{:a 1, :c 3, :b 4}}, {:b 2, :a 1} #{{:a 1, :c 4, :b 2} {:a 1, 
:c 3, :b 2}}}

not exactly what you asked for, but I imagine you can get what you need from 
here.

Cheers, Jay

On Jan 31, 2012, at 7:41 PM, ron peterson wrote:

> hello,
> 
> How to group a collection of maps by multiple keys?
> 
> For example
> 
> (def m1 [{:a 1 :b 2 :c 3}{:a 1 :b 2 :c 4}{:a 1 :b 4 :c 3}{:a 1 :b 4 :c
> 3}])
> 
> (group-by-x [:a :b] m1)
> 
> I'd it like to return this:
> 
> [{:a 1 :b 2}[{:a 1 :b 2 :c 3}{:a 1 :b 2 :c 4}], {:a 1 :b 4}[{:a 1 :b
> 4 :c 3}{:a 1 :b 4 :c 3}]]
> 
> Thanks. R.
> 
> -- 
> 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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: NW UK Clojurians?

2012-01-31 Thread Rick Moynihan
Hi all,

Sorry for missing this; but I've been running the Manchester Clojure Dojo
over the past year.

You can keep an eye out on my twitter stream for more information on
Clojure & FP related events in and around Manchester.

http://twitter.com/RickMoynihan

R.

On 9 December 2011 09:28, Simon Holgate  wrote:

> I guess that strictly I should have said NW England rather than NW UK
> since I don't think may of our Scottish friends would be able to make
> a regular trip south either...
>
> > If it's of interest, there's a Clojure Dojo on the 2nd Monday of every
> > month at Manchester's Madlab:http://manchester.clojuredojo.com/
>
> Thanks. I did see some posts about Madlab a while back but there seems
> to have been no activity on the Clojure dojo website since February.
>
> There do seem to be Clojure things going on in Madlab as recently as
> November though. I'll keep an eye on the calendar.
>
> Simon
>
> --
> 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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Contrib for Clojure 1.3

2012-01-31 Thread Sean Corfield
On Tue, Jan 31, 2012 at 11:59 AM, Mark Engelberg
 wrote:
> I  know there's some documentation about the migration out there, but
> I do sympathize with the original poster -- it can still be
> surprisingly difficult to figure out exactly what lines to put in the
> lein project file to make the new contrib modules work.  I was
> involved in porting a few libraries to 1.3, and I still find it
> confusing.

Steve Losh just made a suggestion on Twitter that I incorporated into
the "Where did..." page - it now explains what goes in Leiningen's
project.clj file and how to discover the artifact/version values.

Any and all additional suggestions for improving that page are welcome
(my email address is listed on that page!). In particular I would love
for original contrib library authors to send me details of code
changes that are required to migrate from a 1.2 contrib to the new
equivalent so that I can add those under each library!
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

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

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


Re: Contrib for Clojure 1.3

2012-01-31 Thread Sean Corfield
On Tue, Jan 31, 2012 at 7:11 AM, kohyama  wrote:
> O.K. Now I see that what we should do is depend on the namespace in contrib
> 1.2.

Some parts of the 1.2 contrib are not compatible with Clojure 1.3 so
your success will depend on exactly which parts you use... It really
would be better to avoid the 1.2 contrib if you can, when using
Clojure 1.3, since none of it is being maintained in that form.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

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

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


Re: Unable to bootstrap ClojureScript

2012-01-31 Thread Sean Corfield
I just tried the git clone and bootstrap on a Mac and on a Ubuntu
machine and it worked. I suspect you got a bad download during the
bootstrap or hit some sort of network?

Sean

On Tue, Jan 31, 2012 at 3:11 PM, HB  wrote:
> Hi,
> Would you please have a look at this thread:
> http://stackoverflow.com/questions/9087817/unable-to-bootstrap-clojurescript
> Thanks for help and 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


Re: [ANN] cljs-uuid 0.0.1 (micro cljs uuid lib)

2012-01-31 Thread Dave Sann
I added the same simple api for clojure (jvm). client code will work across 
clj and cljs.

clojars -  [cljs-uuid "0.0.2"]

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