Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Mats Rauhala
On Tue, Jul 09, 2013 at 08:11:58AM -0700, Alexander Gunnarson wrote: > Of course, tail-call recursion is not possible with JVM, so Clojure uses a * > recur* macro in place of direct recursive function calling. It avoids > blowing the stack as quickly but it's still not 100% "mathematically pure"

Re: [ANN] Varspotting: spotting Clojure Vars for fun and profit!

2013-07-09 Thread Michał Marczyk
On 10 July 2013 06:53, John Gabriele wrote: > Maybe also add it to the listing at > . Good point, thanks! Added now. Cheers, Michał -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post t

Re: ANN Cassaforte 1.0 final is released

2013-07-09 Thread Max Penet
Congratulation on the release! I am glad we found ways to cooperate through libraries, and all the discussions sparked good ideas, so in the end it was well worth it. On Tuesday, July 9, 2013 7:05:59 PM UTC+2, Michael Klishin wrote: > > Cassaforte [1] is a small, feature complete Clojure cli

Re: lein injections across namespace changes

2013-07-09 Thread Mark Engelberg
I agree, this has also bothered me for a while. It would be really nice if the injections would repeat whenever you change namespace. On Tue, Jul 9, 2013 at 10:41 PM, Russell Mull wrote: > I have a profiles.clj that looks like this: > > {:user > {:dependencies [[org.clojure/tools.nrepl "0.2.3"]

lein injections across namespace changes

2013-07-09 Thread Russell Mull
I have a profiles.clj that looks like this: {:user {:dependencies [[org.clojure/tools.nrepl "0.2.3"]] :injections [(use 'clojure.repl) (use 'clojure.pprint) (use 'clojure.java.javadoc)]}} And the repl behaves like this: ; nREPL 0.1.8-preview user> *(doc list)*

Re: Doc about auto-namespaced keywords (e.g. ::user)?

2013-07-09 Thread John Gabriele
On Tuesday, July 9, 2013 4:57:19 PM UTC-4, Bastien Guerry wrote: > > Hi all, > > while reading the documentation for friend, I stumbled upon > "auto-namespaced keywords" -- how can I find more doc about > them? > > Hi Bastian, They're mentioned in , though that doesn

Re: [ANN] Varspotting: spotting Clojure Vars for fun and profit!

2013-07-09 Thread John Gabriele
Neat! Maybe also add it to the listing at . -- John On Tuesday, July 9, 2013 3:11:16 AM UTC-4, Michał Marczyk wrote: > > ...and here comes 0.0.2 with non-buggy Var counts: > > Varspotting report for built-in namespaces: > ==

Re: [ANN] java.jdbc documentation has moved!

2013-07-09 Thread Josh Kamau
Thanks man!... I rely heavily on this library. On Tue, Jul 9, 2013 at 8:39 PM, Michael Klishin wrote: > 2013/7/9 Sean Corfield > >> This opens up contributions to the community at large so I hope to see >> plenty of activity as folks send PRs for their favorite hints, tips, >> and tricks with

matrix: masked arrays

2013-07-09 Thread Brian Craft
Is there any way to do masked arrays (like numpy) with core.matrix, or another lib? I need to be able to, for example, compute a mean while skipping nan values, which is easily done with masked arrays. -- -- You received this message because you are subscribed to the Google Groups "Clojure" gr

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Zach Tellman
I've just released Vertigo [1], which I describe in this thread: https://groups.google.com/forum/#!topic/clojure/BayfuaqMzvs. I suspect this has some bearing on the conversation. Zach [1] https://github.com/ztellman/vertigo On Tuesday, July 9, 2013 8:11:58 AM UTC-7, Alexander Gunnarson wrote:

[ANN] Vertigo: fast, idiomatic C-style structs

2013-07-09 Thread Zach Tellman
Last year, I gave a talk at the Conj on my attempt to write an AI for the board game Go. Two things I discovered is that it was hard to get predictable performance, but even once I made sure I had all the right type hints, there was still a lot of room at the bottom for performance improvement

Re: [ANN] Pedestal-app Tutorial has been released

2013-07-09 Thread John Walker
This is so cool! Brenton and Ryan, thanks so much for taking the time to write this. On Tuesday, July 9, 2013 12:03:58 PM UTC-4, Ryan Neufeld wrote: > > Hey there, Clojurians/Pedestallions! > > I'm pleased to announce the release of a comprehensive tutorial for > pedestal-app: http://bit.ly/ped

Re: [ANN] Pedestal-app Tutorial has been released

2013-07-09 Thread Ryan Neufeld
There definitely isn't a *need* to clone or checkout steps, but it certainly doesn't hurt to have a clean slate at each stage (especially considering at this time pedestal-app errors can be kind of opaque–we're working on that). WRT GitHub issues vs. Mailing lists – it's my personal preference t

ANN: testselector

2013-07-09 Thread Alex Baranosky
At work I noticed that every once in a while we'd forget to add test selectors to our tests, which means that they may not get executed by CI. To prevent this I wrote testselector as a way to periodically check that all deftests have one of the expected metadatas present. It is really simple to u

Re: [ANN] Pedestal-app Tutorial has been released

2013-07-09 Thread danieljomphe
Whoa, for anyone interested in learning pedestal-app or dataflow web programming, it would feel incredibly wrong to _not_ dive into this tutorial! Thanks Ryan and other contributors, and thanks Relevance! Now, regarding the Getting Started page, it suggests we start from the lein new pedestal-a

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Colin Fleming
Hi Mikera, For your mutable var loop example, I think with-local-vars should do what you want. It would be fantastic if the Clojure compiler could optimise these cases better, especially common higher-order use cases (like stream fusion). Unfortunately what always seems to kill the possibility is

core.async pub/sub

2013-07-09 Thread Thomas Heller
Hey, I'm doing some core.async tests and want to create a basic pub/sub model. Messages are >! on one channel and >! to many others. (deftest ^:wip async-test2 (let [subscribers (atom []) events (chan 100)] (go (loop [] (when-let [ev (! events i) (r

Re: edn-format parsers (eg, Common Lisp)?

2013-07-09 Thread Rich Morin
On Jul 9, 2013, at 13:37, Ben Smith-Mannschott wrote: > Perhaps you've not seen this: > > https://github.com/edn-format/edn/wiki/Implementations > > (But there's no CL implementation listed there.) Yep; I had missed that. Thanks! -r -- http://www.cfcl.com/rdmRich Morin http://ww

Re: [ANN] Pedestal-app Tutorial has been released

2013-07-09 Thread Mimmo Cosenza
Hy Rayan, On Jul 9, 2013, at 11:01 PM, Ryan Neufeld wrote: > Mimmo, > > Our focus has definitely been on exploring new ideas; supporting progressive > enhancement has not been a focus of ours. Given the nature of the kinds of > applications we're building in Pedestal today (extremely rich and

Re: Is this idiomatic for a recurring function?

2013-07-09 Thread Niels van Klaveren
> > > So I should use loop together with recur? > > Does the recur at that point recursively call the function, or does it > refer to the loop? > Yes, it refers to the loop. The loop form is usually used to 'hide away' additional parameters that are needed in the loop itself, but not in the fu

Re: Is this idiomatic for a recurring function?

2013-07-09 Thread Laurent PETIT
Besides, there's a bug in your implementation if target-length is bigger that the total cumulative length : it will neer terminate With the hof version I suggested, it just gracefully returns nil :-D 2013/7/9 Laurent PETIT : > Just for fun, a version without loop, : > > (def my-list '("abc" "x00b

Re: Is this idiomatic for a recurring function?

2013-07-09 Thread Niels van Klaveren
For comparison's sake, here's a version made with higher order functions. HOF based functions are usually considered more idiomatic Clojurethan (loop-)recur ones. However, I've found that performance wise loop-recur ones often win. (d

Re: Is this idiomatic for a recurring function?

2013-07-09 Thread Laurent PETIT
Just for fun, a version without loop, : (def my-list '("abc" "x00b" "nanana" "zoot")) (defn length-match [my-list target-length] (first (keep-indexed (fn [idx len] (when (>= len target-length) idx)) (reductions + (map count my-list) (length-match my-list 10) ; => 2 or the

Re: Is this idiomatic for a recurring function?

2013-07-09 Thread Denis Papathanasiou
Hi, and thanks for your reply. On Tuesday, July 9, 2013 4:41:36 PM UTC-4, puzzler wrote > > > What you're looking for is: > (defn get-length-match [my-list target-length] >(loop [my-list my-list, counted-length 0, ind -1] > ...)) > > In your recur, you can now omit target-length, but the

Doc about auto-namespaced keywords (e.g. ::user)?

2013-07-09 Thread Bastien Guerry
Hi all, while reading the documentation for friend, I stumbled upon "auto-namespaced keywords" -- how can I find more doc about them? I'm trying to use friend within a luminus templated webapp, and "lein ring server" returns this error when I use ::user: CompilerException: java.lang.RuntimeEx

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Michał Marczyk
On 9 July 2013 17:11, Alexander Gunnarson wrote: > Final Solution > > (defn solveit-4 [t0 y0 h its] > (let [zero (long 0)] > (loop [t0 (double t0) y0 (double y0) h (double h) its (long its)] > (if (> its zero) > (let [t1 (+ t0 h) > y1 (+ y0 (* h (- t0 y0)))] >

Re: [ANN] Pedestal-app Tutorial has been released

2013-07-09 Thread Ryan Neufeld
Mimmo, Our focus has definitely been on exploring new ideas; supporting progressive enhancement has not been a focus of ours. Given the nature of the kinds of applications we're building in Pedestal today (extremely rich and collaborative ClojureScript applications) I don't see many avenues to

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Michał Marczyk
On 9 July 2013 19:39, Ben Wolfson wrote: > One thing that would be neat, if feasible, would be to make it possible to > do tail call elimination in situations where you can't currently use "recur" > because there's already a target established---if you have something like > [...] I agree, that's

Re: Is this idiomatic for a recurring function?

2013-07-09 Thread Mark Engelberg
On Tue, Jul 9, 2013 at 1:22 PM, Denis Papathanasiou < denis.papathanas...@gmail.com> wrote: > (defn get-length-match [my-list target-length counted-length ind] > (let [current-len (count (first my-list))] > (if (>= counted-length target-length) > ind > (recur (rest my-list) targe

Re: edn-format parsers (eg, Common Lisp)?

2013-07-09 Thread Ben Smith-Mannschott
Perhaps you've not seen this: https://github.com/edn-format/edn/wiki/Implementations (But there's no CL implementation listed there.) //Ben On Tuesday, July 9, 2013, Rich Morin wrote: > I'm intrigued by edn (extensible data notation), as described here: > > https://github.com/edn-format/edn

Is this idiomatic for a recurring function?

2013-07-09 Thread Denis Papathanasiou
Hi, I'm new to clojure and I'd like to know if this is the best/idiomatic way of solving this particular task: I have a list of strings of variable length, and I want to find the position or index number of the list whose cumulative size from the head of the list matches a given target number.

edn-format parsers (eg, Common Lisp)?

2013-07-09 Thread Rich Morin
I'm intrigued by edn (extensible data notation), as described here: https://github.com/edn-format/edn It seems cleaner and more expressive than JSON, so I'm looking into using it for a current project. However, I haven't seen a summary of parser and/or generator implementations for this format

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Jeff Heon
Maybe the Shen programming language could be of interest to you. http://shenlanguage.org/ It's a portable functional typed dialect of Lisp. Looks quite elegant to me, and it targets Clojure, amongst other languages. -- -- You received this message because you are subscribed to the Google Grou

Re: Any suggestions for configuration solution in Clojure or Java world?

2013-07-09 Thread Alex P
I'm using rather trivial solution: store config in Clojure file (as a hash), here's what my config bootstrap looks like: https://github.com/ifesdjeen/utils/blob/master/src/com/ifesdjeen/utils/config.clj lg,  Alex http//twitter.com/ifesdjeen http://clojurewerkz.org/ On June 18, 2013 at 4:51:22

Re: clojure interpreters?

2013-07-09 Thread Gary Trakhman
An issue with an interpreter is keeping semantics in sync with canonical clojure. Unfortunately, since 'Clojure' is a superset of java's semantics, it's possible to have different behavior with regards to classloading and such. Environment-as-a-value means decoupling vars and such from being globa

Re: clojure interpreters?

2013-07-09 Thread kovas boguta
On Mon, Jul 8, 2013 at 8:58 PM, Shantanu Kumar wrote: > An interpreter would be great! I attempted a different approach, which > simply evaluates an S-expression with a user-specified environment > (collection of maps), here: > > https://github.com/kumarshantanu/quiddity > Thanks for the pointer!

Re: clojure interpreters?

2013-07-09 Thread kovas boguta
On Tue, Jul 9, 2013 at 1:22 AM, Mikera wrote: > My post "The Environment as a Value" might be of interest to you. > > > https://groups.google.com/forum/#!searchin/clojure-dev/immutable$20environment/clojure-dev/S8BawG7nzJA/qfCd7hn67aoJ > > It contains a lot of similar ideas. An important point is

Re: [ANN] Pedestal-app Tutorial has been released

2013-07-09 Thread r0man
Hi Pedestal Team, this is great. Thank you very much! Roman On Tuesday, July 9, 2013 6:03:58 PM UTC+2, Ryan Neufeld wrote: > > Hey there, Clojurians/Pedestallions! > > I'm pleased to announce the release of a comprehensive tutorial for > pedestal-app: http://bit.ly/pedestal-app-tutorial. In th

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Ben Wolfson
On Tue, Jul 9, 2013 at 10:46 AM, Gary Trakhman wrote: > The TCO macro already exists: https://github.com/cjfrisz/clojure-tco > > That is super cool. I feel compelled to observe that using a continuation monad run by a trampoline also allows for tail call elimination: user=> (require '[monads.con

Re: ClassCastException in APersistentVector.doEquiv with custom implementation of IPersistentVector

2013-07-09 Thread Gary Trakhman
>From the lack of extending java's Collection in IPersistentVector or associated interfaces, it seems like the intent is for every implementation to extend (proxy) APersistentVector. Is that sufficient for what you're trying to do? None of the methods in there are final. On Tue, Jul 9, 2013 at

ClassCastException in APersistentVector.doEquiv with custom implementation of IPersistentVector

2013-07-09 Thread Vincent
Hello, Suppose I have a byte array representing an array of integers: $ clojure-repl Clojure 1.5.1 user=> (def v (let [a (byte-array (map byte [0 0 0 1 0 2 0 3]))] (reify clojure.lang.IPersistentVector clojure.lang.Seqable (seq [_] (for [i (range 0 (alength a) 2)]

Re: [ANN] clj-wamp 1.0.0-rc1 is released

2013-07-09 Thread Christopher Martin
Glad to hear! Let me know if you run into any rough spots. Over the next few weeks I plan to do some more thorough profiling/load testing for any tuning that could be done before a final 1.0.0 release. On Monday, July 8, 2013 9:09:50 PM UTC-4, Jason Gilman wrote: > > Thanks for the awesome libra

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Gary Trakhman
The TCO macro already exists: https://github.com/cjfrisz/clojure-tco On Tue, Jul 9, 2013 at 1:39 PM, Ben Wolfson wrote: > On Tue, Jul 9, 2013 at 10:28 AM, Mikera wrote: > >> >> A reasonably simple optimisation would be to automatically identify >> self-recursion in tail position and convert it

Re: [ANN] Pedestal-app Tutorial has been released

2013-07-09 Thread Giacomo Cosenza
Hi Pedestallions, as all the others I have been waiting for this tutorial too. Is there a motivation why you decide to not taking into account any progressive enhancement techniques? Should we assume that progressive enhancement is dead? I just went throw this article http://jakearchibald.com

Re: [ANN] java.jdbc documentation has moved!

2013-07-09 Thread Michael Klishin
2013/7/9 Sean Corfield > This opens up contributions to the community at large so I hope to see > plenty of activity as folks send PRs for their favorite hints, tips, > and tricks with this library. > Where to send pull requests: http://github.com/clojuredocs/guides I'm personally very happy th

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Ben Wolfson
On Tue, Jul 9, 2013 at 10:28 AM, Mikera wrote: > > A reasonably simple optimisation would be to automatically identify > self-recursion in tail position and convert it directly to "recur". I think > that's possibly the kind of optimisation pass that the OP was suggesting. > One thing that would b

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Alexander Gunnarson
> > A reasonably simple optimisation would be to automatically identify > self-recursion in tail position and convert it directly to "recur". I think > that's possibly the kind of optimisation pass that the OP was suggesting. > That's exactly the kind of thing I was thinking about with recur.

Re: java.jdbc - (sql/where ...) with multiple values (i.e. 'x in (1,2,3')

2013-07-09 Thread Sean Corfield
clojure.java.jdbc.sql is a deliberately minimal DSL - Justin Kramer's HoneySQL is what I recommend for more expressive SQL construction (that's the "official" recommendation based on discussions Justin and I had about java.jdbc and HoneySQL at Clojure/conj 2012). Sean On Mon, Jul 8, 2013 at 5:47

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Mikera
On Tuesday, 9 July 2013 17:31:21 UTC+1, puzzler wrote: > On Tue, Jul 9, 2013 at 8:11 AM, Alexander Gunnarson < > alexander...@gmail.com > wrote: > >> My idea, which is probably very naive, but one which I'm curious about, >> is: >> >> *Is it possible to have some sort of set of automatic-optimizi

Re: how to create in-memory hsqldb database via java.jdbc

2013-07-09 Thread Sean Corfield
Feel free to submit PRs to improve the documentation at: http://clojure-doc.org/articles/ecosystem/java_jdbc/home.html On Mon, Jul 8, 2013 at 9:22 AM, Colin Yates wrote: > Found it - typically - messed around for hours, then post, the find it. > > The answer is to use something like 'mem:XYZ' fo

Re: [ANN] Pedestal-app Tutorial has been released

2013-07-09 Thread Manuel Paccagnella
I was expecting a tutorial, and now we get this. Speechless. Thank you very much, I'll work through it! Il giorno martedì 9 luglio 2013 18:03:58 UTC+2, Ryan Neufeld ha scritto: > > Hey there, Clojurians/Pedestallions! > > I'm pleased to announce the release of a comprehensive tutorial for > pe

[ANN] java.jdbc documentation has moved!

2013-07-09 Thread Sean Corfield
Extended documentation on java.jdbc is now available on clojure-doc.org: http://clojure-doc.org/articles/ecosystem/java_jdbc/home.html This opens up contributions to the community at large so I hope to see plenty of activity as folks send PRs for their favorite hints, tips, and tricks with this l

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Alexander Gunnarson
Mikera, you hit on exactly what I was trying to say. Great post. I wonder what the feasibility would be to do what you and I are suggesting... It seems like it would take a while to get implemented, if it ever were implemented. Heaven knows I don't want to "get down and dirty with the compiler"

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Alexander Gunnarson
Good point... it was rather a sloppily done example. If I wanted to do an iterative solution, I could have written: (define (expt x n) (define (iter x1 n1 result) (cond ((= 0 n1) 1) ((= 1 n1) result) (else (iter x1 (- n1 1) (* x1

ANN Cassaforte 1.0 final is released

2013-07-09 Thread Michael Klishin
Cassaforte [1] is a small, feature complete Clojure client for Apache Cassandra build around CQL 3. Cassaforte is finally 1.0. Since the last RC, there was one AOT compilation issue resolved, making the most recent version 1.0.1. To learn more about Cassaforte, see our 1.0 release notes: http://b

Re: [ANN] Pedestal-app Tutorial has been released

2013-07-09 Thread Michael Klishin
2013/7/9 Ryan Neufeld > I'm pleased to announce the release of a comprehensive tutorial for > pedestal-app: http://bit.ly/pedestal-app-tutorial. > Ryan, Good to see more documentation for Pedestal! I have a bit of feedback. Maybe it's just me being really dumb but I was confused about where to

Re: [ANN] Pedestal-app Tutorial has been released

2013-07-09 Thread Mayank Jain
Thanks. Will check it out and share my feedback. On Jul 9, 2013 9:34 PM, "Ryan Neufeld" wrote: > Hey there, Clojurians/Pedestallions! > > I'm pleased to announce the release of a comprehensive tutorial for > pedestal-app: http://bit.ly/pedestal-app-tutorial. In this tutorial we > finally *dive de

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Mikera
First of all, great post and a lot of great points. I feel your pain, because I also find myself struggling a lot to make idiomatic code fast in Clojure. Often I end up being forced to use some pretty ugly tricks to get the performance I need. Sometimes I just end up coding inner loops in Java

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Mark Engelberg
On Tue, Jul 9, 2013 at 9:29 AM, Alexander Gunnarson < alexandergunnar...@gmail.com> wrote: > This is not implementing expt as it is usually known, it looks more like >>> repeated squaring to me. >>> >> >> Agreed. There's a certain irony that the OP declares the code pure, >> simple, and beautiful

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Mark Engelberg
On Tue, Jul 9, 2013 at 8:11 AM, Alexander Gunnarson < alexandergunnar...@gmail.com> wrote: > My idea, which is probably very naive, but one which I'm curious about, is: > > *Is it possible to have some sort of set of automatic-optimizing macros that > work on Clojure code to preserve elegance whi

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Alexander Gunnarson
> > This is not implementing expt as it is usually known, it looks more like >> repeated squaring to me. >> > > Agreed. There's a certain irony that the OP declares the code pure, > simple, and beautiful, when it isn't correct code. Seems to me that if you > can't tell at a glance what a 3-li

Re: [ANN] Pedestal-app Tutorial has been released

2013-07-09 Thread Gabriel Horner
Having gone through the tutorial from end to end (before it's release), I can't recommend it enough. If you have any curiosity about dataflow web programming and/or pedestal-app, give yourself a day to go through this. Awesome work Brenton! On Tuesday, July 9, 2013 12:03:58 PM UTC-4, Ryan Neufe

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Mark Engelberg
On Tue, Jul 9, 2013 at 9:14 AM, Ray Miller wrote: > Pure. Simple. Beautiful. (Not that I'm the best Scheme programmer ever, > but to me it looks beautiful, and it conforms well to the base of the > problem. You get the point.) > > >> > This is not implementing expt as it is usually known, it look

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Ray Miller
On 9 July 2013 16:11, Alexander Gunnarson wrote: > > *Example 1: Tail-call recursion* > > *Scheme* > One example would be tail-call recursion. For instance, normally in Scheme > I'd naively implement an iterative exponent function like this: > > (define (expt x n) > > (cond ((= 0 n) 1) > >

Re: [ANN] Pedestal-app Tutorial has been released

2013-07-09 Thread Hussein B.
O, Yeah! Thanks! On Tuesday, July 9, 2013 6:03:58 PM UTC+2, Ryan Neufeld wrote: > > Hey there, Clojurians/Pedestallions! > > I'm pleased to announce the release of a comprehensive tutorial for > pedestal-app: http://bit.ly/pedestal-app-tutorial. In this tutorial we > finally *dive deep* int

[ANN] Pedestal-app Tutorial has been released

2013-07-09 Thread Ryan Neufeld
Hey there, Clojurians/Pedestallions! I'm pleased to announce the release of a comprehensive tutorial for pedestal-app: http://bit.ly/pedestal-app-tutorial. In this tutorial we finally *dive deep* into the guts of pedestal-app and build a distributed multiplayer game using pedestal-app. Major k

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Timothy Baldridge
The thing that should be mentioned, is that we're talking about some pretty insane performance optimizations for a dynamic language. Let's take something like Python for example. All ints are boxed, all the time. If you want to optimize your code, you drop to C (or Cython) so you end up re-writing

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Alexander Gunnarson
Perhaps I didn't choose my examples in a very illustrative way. It was meant to be a general approach. There are probably several other examples where the need for performance causes elegance to suffer, but I'm drawing a blank right now because I'm not a Clojure expert. As I familiarize myself

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread James Reeves
On 9 July 2013 16:11, Alexander Gunnarson wrote: > > An added gripe is that the* else *form within *cond *in Clojure uses a > keyword, *:else*, instead of the more consistent parenthetical form used > in Scheme. I suppose that's to make it less "Lispy." But it just ends up > making it a little les

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Ben Wolfson
Honestly, if you're only doing self-recursion, what makes the recur special form so inelegant? And the "loop" special form isn't very far removed from the Scheme's named let, where you do something like (let loop ((v1 init1) (v2 init2)) ... (loop)) I agree that it's not so nice that recur can *on

Clojure: Elegance vs. Performance?

2013-07-09 Thread Alexander Gunnarson
Hello everyone! It's great to be here with all you fellow Clojurians. Just so you know, this is my first post on this group, so don't shoot me if it's terrible ;) As background, I've been working through SICP and have been loving Scheme. It's almost breathtaking how elegant and clean the code

Livemark-mode

2013-07-09 Thread Andreas Liljeqvist
An Emacs-mode for live-ish display of a markdown-buffer in a webbrowser. Nothing terrible usefull, but it could serve as a small example for people looking to write Emacs-modes that communicate with Clojure. https://github.com/bonega/livemark-mode -- -- You received this message because you ar

Re: clojure interpreters?

2013-07-09 Thread Shantanu Kumar
On Tuesday, 9 July 2013 13:52:59 UTC+5:30, Mikera wrote: > > My post "The Environment as a Value" might be of interest to you. > > > https://groups.google.com/forum/#!searchin/clojure-dev/immutable$20environment/clojure-dev/S8BawG7nzJA/qfCd7hn67aoJ > > It contains a lot of similar ideas. An impor

Re: java.jdbc - (sql/where ...) with multiple values (i.e. 'x in (1,2,3')

2013-07-09 Thread Colin Yates
Just an idle musing - I think DSLs (in general) are really powerful when you can declare them in your application. However, whenever I have to programatically construct them (constructing them based on JSON from the UI for example) I find it is often easier to just use build up the SQL directl

Re: clojure interpreters?

2013-07-09 Thread Laurent PETIT
2013/7/9 Mikera : > My post "The Environment as a Value" might be of interest to you. > > https://groups.google.com/forum/#!searchin/clojure-dev/immutable$20environment/clojure-dev/S8BawG7nzJA/qfCd7hn67aoJ > > It contains a lot of similar ideas. An important point is that you don't > necessarily ne

Re: clojure interpreters?

2013-07-09 Thread Mikera
My post "The Environment as a Value" might be of interest to you. https://groups.google.com/forum/#!searchin/clojure-dev/immutable$20environment/clojure-dev/S8BawG7nzJA/qfCd7hn67aoJ It contains a lot of similar ideas. An important point is that you don't necessarily need an interpreter to get th

Re: Applying function on a vector of tags to extract content from xml

2013-07-09 Thread Vesna Petkovic
Yes, I do mean to return anonymous function, I want to be able to map it over the vector of tags, ie. (map f [:title :venue_name]) and to get this (#(zf/xml1-> % :title zf/text) #(zf/xml1-> % :venue_name zf/text) ) On Monday, July 8, 2013 9:33:40 PM UTC+2, Jeremy Heiler wrote: > > On

Re: group-by replacement when an item has many groups?

2013-07-09 Thread Colin Yates
Thanks Y.Kohyama - it does. On 9 July 2013 03:00, Yoshinori Kohyama wrote: > Hi Colin, > > One more solution, with example data in the process commented > > *(let [f #(range 1 (inc %))* > * coll '(1 2 3)]* > * (->>* > **(for [*x coll*; x = 1, 2, 3 > * y *(*f x*)]* *; y =

Re: java.jdbc - (sql/where ...) with multiple values (i.e. 'x in (1,2,3')

2013-07-09 Thread Colin Yates
Thanks both. On 9 July 2013 01:55, James Ferguson wrote: > > > On Monday, July 8, 2013 5:28:07 PM UTC-4, Colin Yates wrote: >> >> Using the latest release of java.jdbc, does anybody know how I can >> construct a where clause when I want to check if the value is one of many >> values? >> >> For

Re: [ANN] Varspotting: spotting Clojure Vars for fun and profit!

2013-07-09 Thread Michał Marczyk
...and here comes 0.0.2 with non-buggy Var counts: Varspotting report for built-in namespaces: === | Spotter | Var count | |--+---| | Public | 844 | | Unbound |