Re: [ANN] Clojure 1.6.0-RC2

2014-03-21 Thread Mikera
Working fine for me with core.matrix latest build. On Saturday, 22 March 2014 10:46:22 UTC+8, Alex Miller wrote: > > Clojure 1.6.0-RC2 is now available. > > Try it via > - Download: http://central.maven.org/maven2/org/clojure/clojure/1.6.0-RC2 > - Leiningen: [org.clojure/clojure "1.6.0-RC2"] >

Re: namespace dependency

2014-03-21 Thread Dave Sann
thanks, that got me on the right track. it turns out that clojure.tools.namespace.dir/scan can do this. The reason I couldn't see the dependencies I was looking for was because I had managed to write (ns .. (require ...)) instead of (ns ... (:require ...)) in the files I was looking at. This ca

Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-21 Thread Alex Miller
That's pretty weird. 1.6.0-RC2 is out now - I would really appreciate it if you could give it a shot. Alex On Friday, March 21, 2014 5:51:14 PM UTC-5, Stefan Kamphausen wrote: > > Hi, > > > after two days of git bisecting and running my tests over and over again, > I give up. While I can rep

[ANN] Clojure 1.6.0-RC2

2014-03-21 Thread Alex Miller
Clojure 1.6.0-RC2 is now available. Try it via - Download: http://central.maven.org/maven2/org/clojure/clojure/1.6.0-RC2 - Leiningen: [org.clojure/clojure "1.6.0-RC2"] See the full change log here: https://github.com/clojure/clojure/blob/master/changes.md Clojure 1.6.0-RC2 has the following chan

Re: How to update an atom & return the change?

2014-03-21 Thread Jarrod Swart
Just to add to this because I ran across this reading some code a few days ago: https://github.com/overtone/at-at/blob/master/src/overtone/at_at.clj#L43-51 -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@

Re: How did you learn Clojure?

2014-03-21 Thread Jarrod Swart
A tip if you are completely stuck on 4clojure: Often the 4clojure problem will say you can't use a particular function. The first thing I would do is go look at the source code for that function, then I would try to find other functions with similar functionality. Much like learning to paint

Re: apply to quoted form

2014-03-21 Thread Sean Corfield
This happens because a Symbol is a "function that looks itself up in its argument" much like Keywords do: user=> ('a {'a 2 'b 3}) 2 user=> ('b {'a 2 'b 3}) 3 user=> ('b 42) nil And the two argument version provides a default value to return if the symbol is not found: user=> ('c {'a 2 'b 3} ::

Re: apply to quoted form

2014-03-21 Thread John Mastro
On Fri, Mar 21, 2014 at 4:44 PM, John Mastro wrote: > > That's interesting. It seems it's the last form in the list that's being > returned, and it doesn't matter what function you apply > Sigh, clearly sometimes I type faster than I think. That should be "it doesn't matter what symbol you apply",

Re: apply to quoted form

2014-03-21 Thread John Mastro
On Fri, Mar 21, 2014 at 4:44 PM, John Mastro wrote: > > (let [f '(+ 1 1)] > (apply (resolve (first f) (rest f > ;=> 2 > Sorry, I have a typo in there. It should be: (let [f '(+ 1 1)] (apply (resolve (first f)) (rest f))) -- John Mastro -- You received this message because you are subsc

Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-21 Thread Stefan Kamphausen
On Saturday, March 22, 2014 12:41:55 AM UTC+1, Andy Fingerhut wrote: > > That is odd. This is a shot in the dark, and probably unhelpful because I > do not know a good way to verify whether my guess is true, but perhaps the > seqFrom method went from being small enough to be inlined by your JI

Re: apply to quoted form

2014-03-21 Thread John Mastro
On Fri, Mar 21, 2014 at 3:55 PM, Andy Smith wrote: > I came across the following issue when doing problem > > user=> (let [f '(+ 1 1)] (apply (first f) (rest f))) > 1 That's interesting. It seems it's the last form in the list that's being returned, and it doesn't matter what function you apply (

Re: apply to quoted form

2014-03-21 Thread Moritz Ulrich
Andy Smith writes: > I came across the following issue when doing problem > > user=> (let [f '(+ 1 1)] (apply (first f) (rest f))) > 1 > > I could use eval but eval is bad (apparently)... > > Investigating this further I can see that : > > user=> (let [f '(+ 1 1)] (type (first f))) > clojure.lan

Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-21 Thread Andy Fingerhut
That is odd. This is a shot in the dark, and probably unhelpful because I do not know a good way to verify whether my guess is true, but perhaps the seqFrom method went from being small enough to be inlined by your JIT before that change, to being too large to consider for inlining after the chang

Re: rant / cljs in cljs ? :-)

2014-03-21 Thread Moritz Ulrich
I really hope that a small plugin to coordinate cljx/cljsbuild will show up in the near future. I found cljsbuild's crossovers much better integrated and easier to use (but still far inferior to cljx). I agree that a REPL based workflow is much superior, especially with tools like Om which remove

Re: How to update an atom & return the change?

2014-03-21 Thread Jakub Holy
For the interested, this is my (certainly pretty imperfect) solution for changing a value in a state map and returning the old and new value (that can be safely diffed to get the change): (defn swap-in! "Combination of update-in and swap! returning the value at the path before and after." [ato

Re: apply to quoted form

2014-03-21 Thread Andy Smith
that is 'problem 121 from 4clojure' http://www.4clojure.com/problem/121 -- 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

apply to quoted form

2014-03-21 Thread Andy Smith
I came across the following issue when doing problem user=> (let [f '(+ 1 1)] (apply (first f) (rest f))) 1 I could use eval but eval is bad (apparently)... Investigating this further I can see that : user=> (let [f '(+ 1 1)] (type (first f))) clojure.lang.Symbol wheras : user=> (type +) clo

Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-21 Thread Stefan Kamphausen
Hi, after two days of git bisecting and running my tests over and over again, I give up. While I can repeatedly identify the commit which causes the biggest slowdown for me between the 1.5.1 tag and 1.6.0 RC1 I simply refuse to believe that the result of my analysis is correct. On 5045ac124e

[ANN] thi.ng/morphogen - Declarative 3D form evolution through tree-based transformations

2014-03-21 Thread Karsten Schmidt
Hi all, I've just pushed the first (promising) beginnings of a new project to GH and would like to share with you: https://github.com/thi-ng/morphogen/ Building on top of its companions, the recently announced thi.ng/geom & thi.ng/luxor libraries, morphogen provides a set of extensible building b

Re: Concurrently updating two structures

2014-03-21 Thread Raoul Duke
> I am just using this as a learning exercise, I do not need to be lectured > about how to write a game loop... I said obviously since that was my > original request, I am only asking to learn clojure a little better. I > could just drop into java and write a serial loop that does this really fas

Re: Concurrently updating two structures

2014-03-21 Thread Jacob Goodson
Thanks for the code. On Friday, March 21, 2014 4:41:34 PM UTC-4, Gary Trakhman wrote: > > Check out my collision detection here: > https://github.com/gtrak/quilltest/blob/master/src/quilltest/balls.clj#L117 > > I build a map of collided pairs first, then I run through the whole thing > to update

Re: Concurrently updating two structures

2014-03-21 Thread Jacob Goodson
Lol...my goodness... I am just using this as a learning exercise, I do not need to be lectured about how to write a game loop... I said obviously since that was my original request, I am only asking to learn clojure a little better. I could just drop into java and write a serial loop that doe

Re: Concurrently updating two structures

2014-03-21 Thread Gary Trakhman
Check out my collision detection here: https://github.com/gtrak/quilltest/blob/master/src/quilltest/balls.clj#L117 I build a map of collided pairs first, then I run through the whole thing to update the relevant stuff. On Fri, Mar 21, 2014 at 4:37 PM, Raoul Duke wrote: > > update them one at a

Re: Concurrently updating two structures

2014-03-21 Thread Raoul Duke
> update them one at a time. Obviously, I do not want to write something that > updates the enemies and, after the enemies are fully updated, the bullets > get updated. I need something that updates enemies while updating the > bullets, at the same time. Maybe a code example would help? er... i

Re: Concurrently updating two structures

2014-03-21 Thread Jacob Goodson
Ok, I don't think I am communicating or/either comprehending correctly... "it needs to be simultaneous just as far as the atom state-change is concerned" How do I do this? Once the atom is derefenced I would have access to the structures but I need to know how to make sure my code does not se

Re: Concurrently updating two structures

2014-03-21 Thread Gary Trakhman
It doesn't need to be simultaneous within the actual update function (the function that's passed in to swap!), it needs to be simultaneous just as far as the atom state-change is concerned. A faster update function means less contention and restarts. On Fri, Mar 21, 2014 at 4:13 PM, Jacob Goodso

Re: Concurrently updating two structures

2014-03-21 Thread Jacob Goodson
If they were nested what would I use to update them simultaneously? Futures, then roll a loop that would wait till both are realized? On Friday, March 21, 2014 4:00:03 PM UTC-4, Ben Mabey wrote: > > For coordination of this type you could either a) use refs and the STM > or b) put them in the s

Re: Concurrently updating two structures

2014-03-21 Thread Ben Mabey
For coordination of this type you could either a) use refs and the STM or b) put them in the same nested datastructure and put them both in an atom. The latter approach is what I would recommend and what people generally tend to do. If you go down this route you end up with the entire state of

Concurrently updating two structures

2014-03-21 Thread Jacob Goodson
Say I have two data structures.. enemies bullets I want to update them like so... (some-game-loop (update enemies) (update bullets)) If I wanted to make sure that both structures were getting updated at the same time instead of enemies and then bullets; would I use refs here or would

[ANN] clojure-contracts-maps 0.1.0

2014-03-21 Thread Ian Rumford
Hello all, I've pushed to Clojars the first cut of a new library: clojure-contracts-maps The library enables you to apply contracts to the values of map keys by creating getter and putter accessor functions. It also has a few other feature

Re: local mutable state

2014-03-21 Thread Jacob Goodson
Also, you can use straight up java as well inside of loops. I, sometimes, will write a static method, dump the clojure data strcuture over to java, mutate like a crazy man, then slap it back into clojure. I find that loop recur are not as elegant as imperative styles of looping(an opinion of

Re: rant / cljs in cljs ? :-)

2014-03-21 Thread Chas Emerick
This particular trick is a clever one (that I'm afraid I've had some hand in propagating, for the benefit of those that like an "auto" + browser refresh workflow), but it's never going to be particularly efficient. By its very nature, pdo sets up cljx and cljsbuild off and running without any

tools.namespace.repl refresh is trying to refresh test dependencies we don't need

2014-03-21 Thread Christopher Poile
Hi all, clojure.tools.namespace.repl/refresh tries to load (and run) the test files from a dependent project and, since we don't use midje on the main project, it fails when it can't find midje on the classpath. The dependent project is a symlink in the checkouts directory, and that project dep

Re: rant / cljs in cljs ? :-)

2014-03-21 Thread t x
I'm using: "lein pdo cljx auto,cljsbuild auto dev' However, maybe perhaps it's weird timing interaction between cljx and cljsbuild that's making the lag appear more than it actually is. On Fri, Mar 21, 2014 at 8:27 AM, David Nolen wrote: > Unless you're compiling a very large file - with auto :

Re: threading operators

2014-03-21 Thread Andy Smith
Ha! thats perfect! I have seen that one but obviously overlooked it. On Friday, 21 March 2014 15:21:03 UTC, John Wiseman wrote: > > A generalized threading macro, as->, is built into clojure as of 1.5 (I > wonder if clojuredocs.org having so much googlejuice while also being so > out of date mak

Re: How to update an atom & return the change?

2014-03-21 Thread Jakub Holy
Thanks a lot, Stephen! 21. mars 2014 00:57 skrev "Stephen Gilardi" følgende: > There was a stackoverflow question recently that requested a solution for > a similar problem: > > > https://stackoverflow.com/questions/22409638/remove-first-item-from-clojure-vector-atom-and-return-it > > One solutio

Re: How did you learn Clojure?

2014-03-21 Thread Marcus Blankenship
Hey Devin, I don't think I "get" getClojure.com. What is it? On Mar 20, 2014, at 10:54 PM, Devin Walters wrote: > Shameless self-promotion: http://GetClojure.com is something I wrote to > hopefully help people learn Clojure. One of the primary methods I used for > learning Clojure was to do p

Re: local mutable state

2014-03-21 Thread Ben Mabey
On 3/21/14, 5:44 AM, Andy Smith wrote: Im also interested as to why the mutable state approach would be less performant? In the single thread case the locks would be optimized out right? No locks are used when using atoms, only compare-and-swap (CAS) operations. While CAS operations are fast y

Re: om component state

2014-03-21 Thread David Nolen
On Fri, Mar 21, 2014 at 11:45 AM, Adrian Miron wrote: > > > On Thursday, March 20, 2014 10:58:08 PM UTC+2, David Nolen wrote: >> >> >> If you don't pass app state data to this component then you don't need to >> bother with build at all. If you need a component that doesn't need app >> state but d

Re: ANN: Om 0.5.2, Regeant, Quiescent, React interop & more

2014-03-21 Thread Si
Love it thus far. Big thanks! On Sunday, 9 March 2014 00:39:35 UTC, David Nolen wrote: > > While I think Om's approach to application state management delivers > considerable benefit, I think it would be unfortunate if all the labor put > into reusable Om components was confined to Om users. Wit

Re: om component state

2014-03-21 Thread Adrian Miron
On Thursday, March 20, 2014 10:58:08 PM UTC+2, David Nolen wrote: > > > If you don't pass app state data to this component then you don't need to > bother with build at all. If you need a component that doesn't need app > state but does need component local state you need to use om.core/graft.

Re: rant / cljs in cljs ? :-)

2014-03-21 Thread David Nolen
Unless you're compiling a very large file - with auto :optimizations :none you should always get sub-second compile times under auto. David On Fri, Mar 21, 2014 at 10:55 AM, Timothy Baldridge wrote: > are you using "lein cljsbuild auto" ? That's what I use, and I get about > 1-3 sec recompile t

Re: threading operators

2014-03-21 Thread John Wiseman
A generalized threading macro, as->, is built into clojure as of 1.5 (I wonder if clojuredocs.org having so much googlejuice while also being so out of date makes this sort of thing harder to find): (as-> "/tmp" x (foo x) (bar 1 2 x) (baz x 3 4) (quux 5 x 6)) On Fri, Mar

Re: rant / cljs in cljs ? :-)

2014-03-21 Thread Timothy Baldridge
are you using "lein cljsbuild auto" ? That's what I use, and I get about 1-3 sec recompile times for stuff that uses core.async. Timothy On Fri, Mar 21, 2014 at 12:48 AM, t x wrote: > Hi, > > * I'm already using: > > :incremental true > :compiler { :optimizations :none } > > * I'm also aw

Re: How did you learn Clojure?

2014-03-21 Thread Lee Spector
A little thing but I use it in when teaching Clojure to newbies and maybe it'll be useful for others: https://github.com/lspector/clojinc/blob/master/src/clojinc/core.clj -Lee -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: threading operators

2014-03-21 Thread Paul L. Snyder
On Fri, 21 Mar 2014, Andy Smith wrote: > Im wondering if it is worthwhile to create a macro to thread together > arbitrary forms (x, f, g, h) injecting the result into different positions > into the list as required? > > (thread-together (-> x f ->> g -> h)) Maybe swiss-arrows has what you are l

Re: namespace dependency

2014-03-21 Thread Chris Jeris
You might take a look at Tim McCormack's Nephila visualizer: https://github.com/timmc/nephila On Fri, Mar 21, 2014 at 6:33 AM, Dave Sann wrote: > Assuming a set of directories/classpath, is there a simple way to > determine the set of namespaces that are dependent on another namespace? > > in

Re: How did you learn Clojure?

2014-03-21 Thread Andy Smith
Im in the process of learning, and I found that the clojuretv talks and presentations on youtube were useful. Also the video and sample code for Rich Hickey's Ants demo is an excellent intro to how concurrency works in clojure : https://www.youtube.com/watch?v=dGVqrGmwOAw https://gist.github.co

Re: threading operators

2014-03-21 Thread Andy Smith
Im wondering if it is worthwhile to create a macro to thread together arbitrary forms (x, f, g, h) injecting the result into different positions into the list as required? (thread-together (-> x f ->> g -> h)) -- You received this message because you are subscribed to the Google Groups "Clo

Re: threading operators

2014-03-21 Thread Andy Smith
yes I saw that, but it only works from thread-first to thread-last? i.e. this works (-> x (->> f g h)) but I think the following would fail : (->> x (-> f g h)) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to c

Re: Clojure Cookbook is out

2014-03-21 Thread Ryan Neufeld
Thanks everyone, it was a blast working on the book. Until next Thursday, you can get 50% off the digital version of the book with the coupon *WKCLJUR * -Ryan On Thursday, March 20, 2014 10:23:36 AM UTC-4, Thomas wrote: > > woooh > > More good books is good for Cloju

Re: How did you learn Clojure?

2014-03-21 Thread Ulises
When I started learning clojure back in 2010 I decided to give a presentation about it at work. That set a deadline (about 3 months) in which I had to learn the language. Having said that, I learnt /the language/ however wroting code (toy or not) reading other people's code, getting code reviews (a

Re: How did you learn Clojure?

2014-03-21 Thread Alex Miller
It's totally fine to ask here (or on #clojure on IRC). noobs fully welcome. :) On Thursday, March 20, 2014 10:23:42 PM UTC-5, Marcus Blankenship wrote: > > Thanks, Alex! Is it kosher to post questions about 4Clojure here? I'm > stumped on a few, and simply looking up the answer often isn't he

Re: threading operators

2014-03-21 Thread Jim Crossley
Seen this? http://blog.jayfields.com/2012/09/clojure-refactoring-from-thread-last-to.html On Friday, March 21, 2014 7:42:34 AM UTC-4, Andy Smith wrote: > > I have a chain of operations where i want to use a mixture of -> and ->> > (i.e. some functions expect the previous result to be fed into t

Re: local mutable state

2014-03-21 Thread Andy Smith
Excellent point... thanks for the insight On Thursday, 20 March 2014 20:34:47 UTC, tbc++ wrote: > > Not to mention that this isn't local mutation. You are handing the atom to > a closure that then gets wrapped by lazy-seq and returned. So the atom may > actually sit around for some time. > --

Re: local mutable state

2014-03-21 Thread Andy Smith
Im also interested as to why the mutable state approach would be less performant? In the single thread case the locks would be optimized out right? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googleg

threading operators

2014-03-21 Thread Andy Smith
I have a chain of operations where i want to use a mixture of -> and ->> (i.e. some functions expect the previous result to be fed into the second item in its sexpr and some expecting it as the last item of its sexpr. What is the neatest way to chain such functions together. perhaps I should wri

namespace dependency

2014-03-21 Thread Dave Sann
Assuming a set of directories/classpath, is there a simple way to determine the set of namespaces that are dependent on another namespace? in this case, by dependent I mean (for example): A refers B B refers C D dependents of B are A dependents of C are B and A dependents of D are B and A depen

Does lib-nor has function which support https server?

2014-03-21 Thread ljcppunix
Hi, noir.util.middleware.war- handler startup a http server, then which function support https server? Does lib-nor has function which support https server? thank you. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send ema

Re: [GSoC] Mentor for self-hosting ClojureScript compiler project?

2014-03-21 Thread Max Kreminski
Thanks to everyone for the guidance. I've submitted my proposal, basically using this as a high-level overview of the work that would have to be done. Looking forward to hearing back about the project :) Max On Tuesday, March 18, 2014 9:16:25 AM UTC-7, David Nolen wrote: > > Max, > > Just a fai

Re: How did you learn Clojure?

2014-03-21 Thread JPH
The example I use for starting a new language is talking to a remote JSON API. Plenty to choose from, lets you experiment with libraries (http, json), and work with data structures. Also having "lein new " speeds things along, since you're not paralyzed on how to begin. JPH On 03/21/2014 09:08 A

Re: Perfect Functional Shuffle in Clojure

2014-03-21 Thread Peter Brachwitz
Thank you, Andy! Both for spotting my mistake and for your comments on style. On Thursday, March 20, 2014 11:34:00 PM UTC+1, Andy Fingerhut wrote: > > I haven't read all of your code, but note that the Haskell algorithm says > it takes a sequence of random values where the first is in the rang