Re: [ANN] nrepl.el 0.1.3 released

2012-08-22 Thread Tassilo Horn
Tassilo Horn writes: > The standard way of doing completion in modern emacsen is to add your > own completion function to `completion-at-point-functions' and bind > M-TAB to `complete-symbol'. That does all the magic of showing a > *Completions* buffer with multiple possibilities and completing

Re: real-world usage of reducers?

2012-08-22 Thread Ulises
Apologies in advance if this is a silly question but have you tried profiling your code to see where the hotspots are? U -- 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 fro

Re: real-world usage of reducers?

2012-08-22 Thread nicolas.o...@gmail.com
Hi, 3 questions: 1. Are you sure your moves list at the op level is in a vector? Looking at the code for reducers, it seems that it is the only implementation actually doing concurrency. 2. The default block size for spawning a new thread is 512. Meaning that if you have less than 512 first m

Re: real-world usage of reducers?

2012-08-22 Thread nicolas.o...@gmail.com
Sorry, I forgot to convert to a vector: (defn best-move "Start folding here." [dir b d] (r/fold 1 best best (r/map #(Move-Value. (:move %) (search score-by-count (:tree %) d)) (into [] (:children (game-tree dir b next-level)) -- You received this

Re: Folding a reducer inside of a fold

2012-08-22 Thread nicolas.o...@gmail.com
> In particular, if I attempt to replace the `r/reduce` call on line #23, > with a call to `r/fold`, I get the following crash: > This calss sems strange. remaining? should represent a monoid for it to work. Meaning two functions: 1 -> A and (A -> A -> A) In your code, the case with no arg return

Re: real-world usage of reducers?

2012-08-22 Thread Jim - FooBar();
Hi again Nicolas, 1) My moves at the top are a result of r/map...I did try to pou it all in a vector with 'nto []' but nothing changes. 2)well, no there is no way to have 512 moves at any point in in the game!!! The game actually starts with 20 branches (2 moves for each pawn and 2 for eac

Re: real-world usage of reducers?

2012-08-22 Thread Jim - FooBar();
Ok, so I followed your suggestions and the block size did the trick with regards to using all 4 cores of mine...However, even so, I get no performance improvements!!! It still needs close to 4 min to go to level 4 and it still needs 5-6 sec to go to level 2 (a tiny bit faster than the sequentia

Re: real-world usage of reducers?

2012-08-22 Thread nicolas.o...@gmail.com
On Wed, Aug 22, 2012 at 1:53 PM, Jim - FooBar(); wrote: > Ok, so I followed your suggestions and the block size did the trick with > regards to using all 4 cores of mine...However, even so, I get no > performance improvements!!! It still needs close to 4 min to go to level 4 > and it still needs 5

Re: real-world usage of reducers?

2012-08-22 Thread Jim - FooBar();
On 22/08/12 14:08, nicolas.o...@gmail.com wrote: You should see a close to *4 speed up, at least in the level 4. One thing that could happen is if some of your functions are using an atom or a reference and the threads keeps bumping into each other and retrying. Are you sure that both next-level

Re: real-world usage of reducers?

2012-08-22 Thread Jim - FooBar();
So I tried with and without r/fold and I do get an almost 3x speedup for level 2 (a depth i can easily test)... I get 60,598 ms without r/fold VS 23,901 ms with r/fold...so this is good - at least it's showing improvement (more than 2x)! However, level 4 (which is the crucial level i want to

Re: real-world usage of reducers?

2012-08-22 Thread nicolas.o...@gmail.com
> I'm really sorry but I don't follow...I'm only doing (:value best) or > (:value next). best or next return a Move-Value (it has :move and :value > keys) where the :value key could be Integer/MIN_VALUE - I'm not doing > (:value Integer/MIN_VALUE) anywhere... Then you want to write: (defn best ([]

Re: real-world usage of reducers?

2012-08-22 Thread nicolas.o...@gmail.com
You should replace your functions that computes the board by function that does return 30 times the same board. And evaluation function by something that returns a constant value. And check : speed and speed-up for folding. Then you will know for sure whether the slowness comes from the explore an

Re: Deprecation of Swank Clojure, long live nrepl.el

2012-08-22 Thread Warren Lynn
I just gave a quick try on nrepl. It works right out of the box (at least the basics I tried) with jack-in. Thank you. Now I have two questions: 1. I did not not "ritz" before this post. Its debugging capabilities is attractive to me (I have not tried it yet). Is there any plan to have those

Re: What is the meaning of :while in a for ?

2012-08-22 Thread Arie van Wingerden
Extra restrictions on (range of values of) variables used in the for. See here: http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/for 2012/8/21 nicolas.o...@gmail.com > Dear all, > > What is the meaning of :while in a for? > I understand :when, and also that :while jumps more

Re: What is the meaning of :while in a for ?

2012-08-22 Thread nicolas.o...@gmail.com
= On Tue, Aug 21, 2012 at 11:50 AM, Arie van Wingerden wrote: > Extra restrictions on (range of values of) variables used in the for. > See here: > http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/for > The link says nothing about the meaning of the modifiers. (I agree it shoul

Re: Deprecation of Swank Clojure, long live nrepl.el

2012-08-22 Thread Tim King
On Wed, Aug 22, 2012 at 7:56 AM, Warren Lynn wrote: 2. Right now I use "slime-completions" function with auto-complete.el so I > have automatic completion working. I am very attached to auto-complete as > that is a big helper on my coding efficiency. I know there is > "nrepl-complete" command, bu

Re: [ANN] nrepl.el 0.1.3 released

2012-08-22 Thread Tim King
> > Tassilo Horn writes: > > Pull request is sent! > > Thank you for your feedback and the pull request. I'll check that out when I have a spare moment. Cheers, Tim -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to

Re: Deprecation of Swank Clojure, long live nrepl.el

2012-08-22 Thread Baishampayan Ghose
> Thanks for being loyal users, and please do give nrepl.el a try. I gave nrepl.el a shot today and I was quite impressed to say the least. There were a couple of minor annoyances though - * M-. on a JVM inter-op call throws an exception. This should be handled gracefully. * When using M-x nrepl

Re: Lazily extract lines from large file

2012-08-22 Thread Stephen Compall
On Aug 17, 2012 4:53 PM, "David Jacobs" wrote: > Okay that's great. Thanks, you guys. Was read-lines only holding onto > the head of the line seq because I bound it in the let statement? No; (partial nth values) holds on to values, and map holds on to the function you give it. Omitting needless

Re: [ANN] nrepl.el 0.1.3 released

2012-08-22 Thread Tassilo Horn
Tim King writes: Hi Tim, >> Tassilo Horn writes: >> >> Pull request is sent! >> > Thank you for your feedback and the pull request. You're welcome. > I'll check that out when I have a spare moment. Great. Bye, Tassilo -- You received this message because you are subscribed to the Google G

Re: Folding a reducer inside of a fold

2012-08-22 Thread Joshua Ballanco
On Wed, Aug 22, 2012 at 10:48:03AM +0100, nicolas.o...@gmail.com wrote: > > In particular, if I attempt to replace the `r/reduce` call on line #23, > > with a call to `r/fold`, I get the following crash: > > > This calss sems strange. > remaining? should represent a monoid for it to work. > > Mean

nREPL 0.2.0-beta9 released

2012-08-22 Thread Chas Emerick
I have recently released [org.clojure/tools.nrepl "0.2.0-beta9"]. No incompatibilities are known between this release and prior betas. Much of this release was focused on simplifying: (a) The use of third-party middlewares; constructing an nREPL handler had become far too difficult from a user

Re: Deprecation of Swank Clojure, long live nrepl.el

2012-08-22 Thread Chas Emerick
On Aug 22, 2012, at 12:56 PM, Baishampayan Ghose wrote: > * M-x repl should show me the default host/port automatically (does > nREPL have a default port at all?) No, nREPL does not yet have a default port, but it's a known TODO item: http://dev.clojure.org/jira/browse/NREPL-3 I suppose I shoul

Re: Deprecation of Swank Clojure, long live nrepl.el

2012-08-22 Thread Baishampayan Ghose
On Wed, Aug 22, 2012 at 11:56 PM, Chas Emerick wrote: >> * M-x repl should show me the default host/port automatically (does >> nREPL have a default port at all?) > > No, nREPL does not yet have a default port, but it's a known TODO item: > > http://dev.clojure.org/jira/browse/NREPL-3 > > I suppos

Re: Deprecation of Swank Clojure, long live nrepl.el

2012-08-22 Thread Chas Emerick
On Aug 22, 2012, at 2:30 PM, Baishampayan Ghose wrote: >>> * M-x repl should show me the default host/port automatically (does >>> nREPL have a default port at all?) >> >> No, nREPL does not yet have a default port, but it's a known TODO item: >> >> http://dev.clojure.org/jira/browse/NREPL-3 >>

Re: Deprecation of Swank Clojure, long live nrepl.el

2012-08-22 Thread Tassilo Horn
Baishampayan Ghose writes: > * Backspace with paredit is broken That's fixed in a pull request of mine which also implements a major overhaul of the completion mechanism. Bye, Tassilo -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this

[viewing clojure datastructures] Is there something better than clojure.inspector?

2012-08-22 Thread Denis Labaye
Hi everyone, The clojure.inspector functions are ... mmm ... a bit "rough on the edge" =) Is there any lib that provide better support for exploring Clojure data-structures? I am surprised I didn't found anything on Google, GitHub, ... Data-structures are at the core of Clojure, so being able

Re: [viewing clojure datastructures] Is there something better than clojure.inspector?

2012-08-22 Thread Nahuel Greco
Another nice and simple addition to clojure.inspector would be add auto-refreshing, so you can pass a reference and it and will display always his latest version (maybe by using a watcher). It will be nice for live debugging. Saludos, Nahuel Greco. On Wed, Aug 22, 2012 at 5:58 PM, Denis Labaye w

Re: [viewing clojure datastructures] Is there something better than clojure.inspector?

2012-08-22 Thread Frank Siebenlist
Check out clj-ns-browser ("https://github.com/franks42/clj-ns-browser";). When a var is defined, you can look at it's value, which is presented with pprint, which means that most data structures are nicely displayed. When the value is a list/tree-like data structure, you can bring up Rich's ori

Re: [viewing clojure datastructures] Is there something better than clojure.inspector?

2012-08-22 Thread Nahuel Greco
You can set the clj-ns-browser browser to auto-refresh but you need to utilize a full browser window just to watch a Var, and also the value not as nicely displayed as using clojure.inspector. A nice addition to clj-ns-browser will be to make possible create many auto-refreshing clojure.inspector l

Re: Deprecation of Swank Clojure, long live nrepl.el

2012-08-22 Thread Warren Lynn
Hi Warren, > > You may want to check out https://github.com/purcell/ac-nrepl. > > Cheers, > Tim > > Thank you. I tried it out. It basically works but has glitches: 1. If I type "(clojure.repl/", right after the forward slash, I got a exception "java.lang.ClassNotFoundException: clojure.repl"

Re: [viewing clojure datastructures] Is there something better than clojure.inspector?

2012-08-22 Thread Nahuel Greco
You can set the clj-ns-browser browser to auto-refresh but you need to utilize a full browser window just to watch a Var, and also the value not as nicely displayed as using clojure.inspector. A nice addition to clj-ns-browser will be to make possible create many auto-refreshing clojure.inspector l

Re: real-world usage of reducers?

2012-08-22 Thread Jim - FooBar();
On 22/08/12 15:16, nicolas.o...@gmail.com wrote: You should replace your functions that computes the board by function that does return 30 times the same board. And evaluation function by something that returns a constant value. And check : speed and speed-up for folding. Then you will know for

Re: [viewing clojure datastructures] Is there something better than clojure.inspector?

2012-08-22 Thread Denis Labaye
On Wed, Aug 22, 2012 at 11:33 PM, Frank Siebenlist < frank.siebenl...@gmail.com> wrote: > Check out clj-ns-browser ("https://github.com/franks42/clj-ns-browser";). > This is really cool! I love the tree like view of the global environmental. Great for exploring clojure.core and libs. It doesn't

Re: nREPL 0.2.0-beta9 released

2012-08-22 Thread Brent Millare
First, great work on nrepl! It's a great tool. Second, I noticed you recently updated leiningen repl to include beta9. I was having problems trying to get piggieback to work with the older leiningen which depended on beta6. I was trying to customize profiles so that I could depend on beta9 but

Parser combinators in parsatron

2012-08-22 Thread Alexsandro Soares
Hi all, I'm using the Parsatron library to build parser combinators. I have the following definition: (defparser anbn [] (let->> [as (many (char \a)) bs (times (count as) (char \b))] (always (concat as bs (defparser xdny [] (let->> [ds (between (char \x) (char \y)

dumping maps out to XML

2012-08-22 Thread larry google groups
Forgive me if this has been asked before. I am a beginner. I have a data structure that is composed of maps nested inside of a map. What is the easiest way to dump this out as XML? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gro

Re: Deprecation of Swank Clojure, long live nrepl.el

2012-08-22 Thread Leonardo Borges
I must be missing something here. I followed the steps on the leiningen upgrade wiki page and everything seemed fine. However, even thought my project has an explicit dependency on Clojure 1.4.0, lein repl is starting a session with Clojure 1.2.1 Can't really see where I've gone wrong. Does this

Re: [viewing clojure datastructures] Is there something better than clojure.inspector?

2012-08-22 Thread blackblock
I get this with Lein2 with lein repl: IllegalStateException escape-html already refers to: #'hiccup.core/escape-html in namespace: hiccup.page clojure.lang.Namespace.warnOrFailOnReplace (Namespace.java:88) On Thursday, August 23, 2012 7:33:44 AM UTC+10, FrankS wrote: > > Check out clj-ns-brows

Re: Parser combinators in parsatron

2012-08-22 Thread Armando Blancas
pL first tries anbn: many parses zero \a's; then times has to parse zero \b's; and the parser returns the concatenation of two empty lists. An empty list isn't a failure as far as the parser either is concerned, so it won't try xdny in that case. On Wednesday, August 22, 2012 5:38:56 PM UTC-7,

Re: Deprecation of Swank Clojure, long live nrepl.el

2012-08-22 Thread Leonardo Borges
Moreover, not only it starts an old version of Clojure, but it randomly picks a clojure version each time I start the repl (?!) from within the same project directory $ lein repl nREPL server started on port 7888 REPL-y 0.1.0-beta10 Clojure 1.3.0 $ lein repl nREPL server started on port 7888 REP

Re: nREPL 0.2.0-beta9 released

2012-08-22 Thread Chas Emerick
The requirement noted in Piggieback's README on what's currently in Leiningen master isn't related to nREPL (Piggieback itself doesn't depend on -beta9 and should work just fine with -beta6); it's due to the Leiningen's new support for customizing the handler or middleware used by nREPL endpoint

Re: nREPL 0.2.0-beta9 released

2012-08-22 Thread Brent Millare
Good to know I wasn't going crazy trying to find the right profile setup. On another note (and slightly OT), taking the return value of cljs.closure/build of the cljs file with the call to repl/connect and inserting the outputed js into the index.html appears to be sufficient from the clojuresc

Re: Deprecation of Swank Clojure, long live nrepl.el

2012-08-22 Thread Leonardo Borges
Nevermind. I used lein deps :tree to analyze my current dependency tree an realized korma depended on Clojure 1.3.0 - why lein was loading 1.2.1 sometimes is still beyond me. I upgraded Korma and lein repl now respects my preference for clojure 1.4.0 All is well in the world. Sorry for the noise.

Re: [viewing clojure datastructures] Is there something better than clojure.inspector?

2012-08-22 Thread Denis Labaye
at which point? $ lein deps $ lein repl user=> (use 'clj-ns-browser.sdoc) user=> (sdoc) On Thu, Aug 23, 2012 at 4:48 AM, blackblock wrote: > I get this with Lein2 with lein repl: > > IllegalStateException escape-html already refers to: > #'hiccup.core/escape-html in namespace: hiccup.page > c

Re: [viewing clojure datastructures] Is there something better than clojure.inspector?

2012-08-22 Thread Denis Labaye
On Thu, Aug 23, 2012 at 8:39 AM, Denis Labaye wrote: > at which point? > > $ lein deps > $ lein repl > user=> (use 'clj-ns-browser.sdoc) > user=> (sdoc) > > > > On Thu, Aug 23, 2012 at 4:48 AM, blackblock wrote: > >> I get this with Lein2 with lein repl: >> >> IllegalStateException escape-html al