Re: -> operator and monads

2013-04-03 Thread Alan Malloy
Not even that: -> is not a function composition operator at all, but a form-rewriting macro. You can perfectly well write (-> [x xs] (for (inc x))) to get (for [x xs] (inc x)), and that is not composing any functions. The two things are entirely separate. On Wednesday, April 3, 2013 12:45:55 PM

ANN: vim-redl -- advanced fuzzy omnicompletion and VimClojure-style repl with enhanced debugging features

2013-04-03 Thread David Greenberg
Although I've announced vim-redl in the past, now you can reap the benefits of all of its features without leaving fireplace behind! Just go to https://github.com/dgrnbrg/vim-redl for installation instructions, and you'll end up with advanced fuzzy omnicompletion and a full-fledged repl (accessible

Re: -> operator and monads

2013-04-03 Thread Plínio Balduino
Now it's clear. Thank you Plínio On Wed, Apr 3, 2013 at 4:45 PM, Marko Topolnik wrote: > I guess you mean the monadic bind operation, but -> is not it. The only > conceptual connection between *bind* and -> is that they are both some > kind of function composition operators. > > -marko > > > O

Re: -> operator and monads

2013-04-03 Thread Marko Topolnik
I guess you mean the monadic bind operation, but -> is not it. The only conceptual connection between *bind* and -> is that they are both some kind of function composition operators. -marko On Wednesday, April 3, 2013 8:21:43 PM UTC+2, Plinio Balduino wrote: > > Hi there > > Is it correct to sa

-> operator and monads

2013-04-03 Thread Plínio Balduino
Hi there Is it correct to say that -> operator is a kind of monad in Clojure? Thank you in advance. Plínio Balduino -- -- 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 fr

Re: Attempt at rethrow macro

2013-04-03 Thread Nathan Davis
Just because there does not appear to be any logic behind a certain decision does not mean it's a bug. That being said, I've always thought of the compiler workflow in Lisp as being (conceptually): Reader / Data -> Macro Expander -> Compiler. Naturally, macros must be expanded in the macro ex

Re: nested reduce/reduce-kv idiom

2013-04-03 Thread John D. Hume
Destructure the map entry. (for [[k vs] some-map, v vs] v) or whatever. On Wed, Apr 3, 2013 at 1:44 PM, Jim - FooBar(); wrote: > Hi all, > > I 've recently come across this idiom (instead of nested reduces - from > Christophe's blog post of course!) > > (reduce f init (for [x xs, y x, z y] z)) ;;

nested reduce/reduce-kv idiom

2013-04-03 Thread Jim - FooBar();
Hi all, I 've recently come across this idiom (instead of nested reduces - from Christophe's blog post of course!) (reducef init (for[x xs, y x, z y] z)) ;;it took me a while to realise how cool this is :) I'm trying to do the same for reduce-kv (for nested maps) but doesn't quite

Re: WAT? BigInt instead of Long?

2013-04-03 Thread Gary Verhaegen
On 3 April 2013 17:53, Gary Verhaegen wrote: > Do you really need ratios ? > > Intuitively, the management of ratios should be much more of a problem > than the use of BigInts, performance-wise. You did not provide many > details on the calculations you are trying to do, but I would advise > you t

Re: WAT? BigInt instead of Long?

2013-04-03 Thread Cedric Greevey
Is there a reason for not using primitive doubles? You won't get perfect precision but you won't get slow, high-precision math or tons of objects created and garbage collected either. (* (/ 1.0 255.0) 255.0) 1.0 -- -- You received this message because you are subscribed to the Google Groups "Cl

Re: WAT? BigInt instead of Long?

2013-04-03 Thread Simone Mosciatti
OT: @Peter Mancini I would like to invite you, like* everybody else who is doing a lot of math and especially matrix*, to check out core.matrix ( https://github.com/mikera/matrix-api) and leave as many feedback as possible about everything, from design to implementation of library to performanc

Re: WAT? BigInt instead of Long?

2013-04-03 Thread Peter Mancini
Those are good answers and it is acceptable, but what ends up happening is that it creates objects. I just used a profiler and that operation inside of my code for a typical run is executed 1,500 million times. It makes up the lions share of self-time measurements. Each object needs construction

Re: why can I re-use local variables if Clojure is immutable?

2013-04-03 Thread Chris Perkins
On Tuesday, April 2, 2013 1:09:25 PM UTC-6, larry google groups wrote: > > > If Clojure is suppose to emphasize immutability, why can I do this: > > kiosks-clojure.core=> (let [ > #_=> mega (+ 1 1) > #_=> mega (+ 1 mega) > #_=> mega (+ 1 mega) >

Re: Fastest way to generate comma-separated list

2013-04-03 Thread Max Penet
I am curious, what data store are you interacting with? On Wednesday, April 3, 2013 2:01:33 PM UTC+2, Ryan wrote: > > Most SQL Database support array types natively > > > If you are using MySQL unfortunately there isn't and the OP (including > myself) probably needs this because his RDBMS does n

Re: Fastest way to generate comma-separated list

2013-04-03 Thread Ryan
> > Most SQL Database support array types natively If you are using MySQL unfortunately there isn't and the OP (including myself) probably needs this because his RDBMS does not support the array type. On Wednesday, April 3, 2013 2:47:45 PM UTC+3, Thomas Heller wrote: > > My Question would be

Re: Fastest way to generate comma-separated list

2013-04-03 Thread Thomas Heller
My Question would be: why are you trying to do this? You mentioned you are working with a database, I assume that means SQL (as almost all NoSQL Databases support some kind of JSON which doesnt require your "workarround"). Most SQL Database support array types natively, while support might be a