Re: Clojure on PyPy

2012-02-09 Thread kovas boguta
This article on RPython and PyPy is pretty good, helped me understand what the fuss is about: http://tratt.net/laurie/tech_articles/articles/fast_enough_vms_in_fast_enough_time Pretty cool stuff. Will clojure-py allow us to write our own VM's using clojure? On Mon, Nov 28, 2011 at 9:23 AM, Ti

Re: Destructuring a seq of maps

2012-02-09 Thread Manuel Paccagnella
On 08/02/2012 03:05, Asim Jalis wrote: I frequently find myself passing around maps that are basically structs. I use this macro to destructure the fields into let variables. ; Macro. (defmacro def-fields [struct-name & fields] (let [field-symbol-vector (->> fields (map name) (map symbol) ve

Re: Calling all Melbourne, Australia, Clojure users

2012-02-09 Thread James Sofra
Leonardo, Thanks for the support, if I am ever in Sydney I'll come and visit. Cheers, James -- 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

Re: Calling all Melbourne, Australia, Clojure users

2012-02-09 Thread James Sofra
Hi all, Good to see some interest! I have now started a meetup page http://www.meetup.com/clj-melb/ Will organise more once we have some members. We have a place we should be able to meet in the CBD. Cheers, James Sofra -- You received this message because you are subscribed to the Google Gr

Re: Clojure on PyPy

2012-02-09 Thread Timothy Baldridge
> Will clojure-py allow us to write our own VM's using clojure? TL/DR: yes Long version: RPython simply is a restriction on what bytecodes can do in a given set of branches in a python program. So the cool thing about RPython is, you define a main(argv[]) function, and then point the PyPy transla

Ann [js-wrap "0.0.1"] wrap js libs for clojurescript

2012-02-09 Thread Dave Sann
Following on from my question this afternoon on foreign libs (https://groups.google.com/d/topic/clojure/kqtCC_stbEU/discussion) alpha Wraps a no gclosure compliant js file. Injects a script tag directly into your page whenever you require and use the wrapper lib No need to include js files in y

Re: Ann [js-wrap "0.0.1"] wrap js libs for clojurescript

2012-02-09 Thread Dave Sann
apologies the lib is called wrap-js [wrap-js "0.0.1"] -- 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

Re: Ann [js-wrap "0.0.1"] wrap js libs for clojurescript

2012-02-09 Thread Dave Sann
updated to 0.0.2 - supporting urls as well as local files. -- 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 firs

Google Summer of Code 2012 - any mentors?

2012-02-09 Thread Alexander Yakushev
Hello, I am wondering if there is there anybody willing to take part in this year's GSoC as a mentor? I would be happy to contribute this summer's time to hacking Clojure and there are probably more students that would. Best regards, Alexander -- You received this message because you are subscr

Re: No show?

2012-02-09 Thread Stuart Halloway
> clojure.reflect/reflect gets you the same information as a big 'ole data > structure. You can pprint it for readability. > > The only thing that was not ported was the formatted text output, which would > be easy enough to reproduce based on `reflect`. In particular, reflect + clojure.pprint/

Re: Google Summer of Code 2012 - any mentors?

2012-02-09 Thread Baishampayan Ghose
Alexander, A discussion is currently ongoing in the Clojure Dev mailing list. We are still waiting for someone from Clojure/core to chime in. Regards, BG On Thu, Feb 9, 2012 at 8:53 PM, Alexander Yakushev wrote: > Hello, > > I am wondering if there is there anybody willing to take part in this

Re: Clojurescript options :foreign-libs (and an idea seeking opinions)

2012-02-09 Thread David Nolen
I'm not following your line of reasoning - http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html, shows that :foreign-libs and advanced compilation work fine together. David On Wed, Feb 8, 2012 at 9:22 PM, Dave Sann wrote: > I think that the use of :foreign-libs to includ

Re: Clojure CDT up, cont, down, local-names throws arity errors after hitting breakpoint

2012-02-09 Thread Sean Corfield
On Wed, Feb 8, 2012 at 10:16 PM, George Jahad wrote: > If you use Emacs and Swank-clojure, it is much > easier to use swank-cdt, as your UI: > > http://georgejahad.com/clojure/swank-cdt.html I just want to chime in and say swank-clojure 1.4.0 has made this process so much simpler and it really is

novice question, performance surprise

2012-02-09 Thread Manuel Paccagnella
Sorry for what I guess is a pretty basic question. I've written for practice a simple function that takes a sequence of numbers and returns a map with the odd and even ones. No big deal: (defn separate-nums [coll] (hash-map :even (filter even? coll) :odd (filter odd? coll))) But I th

Re: novice question, performance surprise

2012-02-09 Thread Steve Miner
filter is lazy so it won't actually do the work unless the values are needed. To get a reasonable time, you need to use the result for some computation. Try something like this: (defn sum-all [m] (reduce + (apply map + (vals m (time (sum-all (separate-nums (range 1 On Feb 9, 201

Re: noob question on lein and 1.4

2012-02-09 Thread ambert ho
ok, thanks so much! :) On Wed, Feb 8, 2012 at 1:58 PM, Phil Hagelberg wrote: > Ambert Ho writes: > > > So I bought a couple of books on Clojure and one of them tells me to > > use Lein, the other tells me to download from github. > > > > - in lein repl, (clojure-version) gives me '1.2' > > - in

Re: Persistent collections and garbage collection

2012-02-09 Thread dgrnbrg
It seems to me that a generational collector would have problems collecting Clojure's garbage production pattern. Luckily, the oracle/ hotspot jvm has a continuous collecting compacting GC called G1. That should mitigate oldspace collection latency spikes. Enable with -XX: +UnlockExperimentalVMOpti

Re: ClojureScript def, vars, and binding

2012-02-09 Thread Brandon Bloom
It seems like the missing word from my vocabulary was "conveyance". I've spent a fair bit of time toying with Clojure, ClojureScript, and their respective implementations. It seems like Clojure 1.3 augmented futures and agents with binding-conveyor-fn, clojure.lang.Var/getThreadBindingFrame, an

Re: mixins/multiple inheritance

2012-02-09 Thread Matthias Diehn Ingesman
The problem with the protocols approach is that it leads to an explosion in the number of explicitly defined records. His example was only with labels, but I can imagine he might have borders and any number of other decorations on the widgets, in which case he would need something like (defreco

Re: Clojure CDT up, cont, down, local-names throws arity errors after hitting breakpoint

2012-02-09 Thread Sean Neilan
It works! Thank you so much for looking into this! I really appreciate what you have done. I went through the rest of the documentation and found three other minor misnomers. One, if you set a breakpoint on a function defined in the repl, you'll have problems. As long as anything you set a breakp

Re: Clojure CDT up, cont, down, local-names throws arity errors after hitting breakpoint

2012-02-09 Thread Sean Neilan
I agree. I'm a Vim user currently but with Lisp/Clojure, Emacs is the way to go. On Thu, Feb 9, 2012 at 11:18 AM, Sean Corfield wrote: > On Wed, Feb 8, 2012 at 10:16 PM, George Jahad > wrote: > > If you use Emacs and Swank-clojure, it is much > > easier to use swank-cdt, as your UI: > > > > http

Re: Clojure CDT up, cont, down, local-names throws arity errors after hitting breakpoint

2012-02-09 Thread Sean Neilan
There's so much documentation about how to set up emacs with clojure but not a lot of sources saying which documentation works. Should I trust the readme for swank-clojure, the dev.clojure.org site, the comments on dev.clojure.org, the blog post at technomancy.us/149 or the radically simplified se

Re: Clojurescript options :foreign-libs (and an idea seeking opinions)

2012-02-09 Thread Dave Sann
Maybe - but I don't think so. I tested with jquery this morning - to try and re-confirm - details appended at the end of this post I think that this falls into the: "If the library you want to use simply doesn't work with advanced compilation" at the bottom of the link you added My unders

Re: Clojurescript options :foreign-libs (and an idea seeking opinions)

2012-02-09 Thread David Nolen
Ah yes. What you want is something like "extern-lib" (not saying it will be called that) - some way for you to include JS that won't get submitted to advanced compilation yet which has externs to define. Please open a ticket in JIRA for this. David On Thu, Feb 9, 2012 at 6:24 PM, Dave Sann wrot

Re: Clojurescript options :foreign-libs (and an idea seeking opinions)

2012-02-09 Thread Dave Sann
yes exactly, but I would like to be able to package js libs as jars - not specify them directly to the build in the cljsc opts. I have done half of this, here: https://github.com/davesann/wrap-js see the following examples: https://github.com/davesann/cljs-bcrypt-wrapper https://github.com/dav

Re: Clojurescript options :foreign-libs (and an idea seeking opinions)

2012-02-09 Thread Dave Sann
created: http://dev.clojure.org/jira/browse/CLJS-147 with pointer to discussion here. -- 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 - plea

Re: Persistent collections and garbage collection

2012-02-09 Thread pron
Yes, that's what I thought. Does anyone have any experience with Clojure's garbage production pattern (esp. due to the persistent collection) and it's behavior with the older GCs as well as with G1? -- You received this message because you are subscribed to the Google Groups "Clojure" group. T

Re: Clojure on PyPy

2012-02-09 Thread kovas boguta
This stuff is amazing. The big question for me is how this relates to macros. This sounds like a metaprogramming ability, where instead of changing the source code, you are changing the implementation layer. Here is a concrete use case I'm interested in: optimizing algorithms. I have some set of

Re: Clojure CDT up, cont, down, local-names throws arity errors after hitting breakpoint

2012-02-09 Thread Phil Hagelberg
Sean Neilan writes: > Should I trust the readme for swank-clojure, the dev.clojure.org > site, the comments on dev.clojure.org, the blog post at > technomancy.us/149 or the radically simplified setup here? The swank-clojure readme should be the most reliable. You may find a better explanation o

Re: Clojure on PyPy

2012-02-09 Thread kovas boguta
Another question: can multiple VMs live inside the same process boundary? So that code in VM1 (clojure-py) can call code in VM2 (pypy) with no overhead. There is also a third case, intermediate between optimizing vms for algorithms and optimizing for full blown languages. Think about implementing

Re: Clojure CDT up, cont, down, local-names throws arity errors after hitting breakpoint

2012-02-09 Thread Sean Neilan
On Thu, Feb 9, 2012 at 7:06 PM, Phil Hagelberg wrote: > Sean Neilan writes: > > > Should I trust the readme for swank-clojure, the dev.clojure.org > > site, the comments on dev.clojure.org, the blog post at > > technomancy.us/149 or the radically simplified setup here? > > The swank-clojure read

Re: Clojure CDT up, cont, down, local-names throws arity errors after hitting breakpoint

2012-02-09 Thread Phil Hagelberg
Sean Neilan writes: > It's on the github page at the top. Forgive me if I'm slow, but I can't find it. Can you be more specific? The canonical page for swank-clojure is https://github.com/technomancy/swank-clojure Are you talking about instructions for using swank-clojure.el or something else?

Re: mixins/multiple inheritance

2012-02-09 Thread David Nolen
I think the suggestions thus far are not ideal. Both protocols and multimethods provide a way to define a default case. The default case gives you opportunity to adopt a delegation / component based design. (defprotocol IFlightOrgan (flight-organ [this])) (defprotocol IFlight (can-fly? [this]

Re: Persistent collections and garbage collection

2012-02-09 Thread Sean Corfield
On Thu, Feb 9, 2012 at 4:30 PM, pron wrote: > Yes, that's what I thought. Does anyone have any experience with Clojure's > garbage production pattern (esp. due to the persistent collection) and it's > behavior with the older GCs as well as with G1? These are the options we run with in production

wrap-js : clojurescript - want some jquery plugins? managed? no problem.

2012-02-09 Thread Dave Sann
I have what I think is a really nice method for using jquery and other js libs and their dependencies sanely in clojurescript. (it will be even better if/when http://dev.clojure.org/jira/browse/CLJS-147 is resolved) by using wrap-js (https://github.com/davesann/wrap-js) you can have clojuresc

Re: wrap-js : clojurescript - want some jquery plugins? managed? no problem.

2012-02-09 Thread Dave Sann
one note that just came to mind. I can see a potential issue arising with the versions of wrapped js libs and compatibility - particularly for things like plugins. I haven't done this yet. But it I think that it may be important to be be explicit about the version of the js lib you are wrapping

Re: wrap-js : clojurescript - want some jquery plugins? managed? no problem.

2012-02-09 Thread Dave Sann
ok rules for wrapping. 1. include the version of the wrapped js lib in the name of the project/jar - so that users can choose which version they want. 2. use a generic namespace to inline the js lib - e.g jquery.inline - not jquery-1-7.inline (allows you to switch versions) 3. do not include an

Re: wrap-js : clojurescript - want some jquery plugins? managed? no problem.

2012-02-09 Thread Dave Sann
updated to follow my own rules and by way of example: * [cljs-query-1-7-1 "0.0.1"] for jquery version 1.7.1 * [cljs-jquery-sparkline-1-6 "0.0.1"] for sparkline version 1.6 -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to