Re: Interest in a commercial IDE for Clojure?

2013-08-25 Thread Colin Fleming
Thanks for all the interest in this. With one thing and another I've been
otherwise occupied over the last couple of weeks, but I'll be back onto it
next week. I'll try to get a public beta set up next week and let everyone
know.

Thanks,
Colin


On 25 August 2013 12:18, Mark Mandel  wrote:

> I'd be keen on this too - but probably more as a plugin than a standalone
> IDE (a'la WebStorm, RubyMine, etc).  I already have a licence for IntelliJ,
> so would be wanting to have a better plugin than La Clojure.
>
> I just started trying to work out my workflow with IntelliJ and Clojure,
> and found it kinda painful in places, so any improvement there I'd love to
> have, and I'd be happy to pay for it too.
>
> Very interested to see what you have. Any chance for a video teaser? ;)
>
> If you are looking for alpha/beta testers ;) I'm sure there are a few of
> us willing to put our hands up.
>
> Mark
>
>
> On Sun, Aug 25, 2013 at 12:42 AM, Francesco Bellomi <
> francesco.bell...@gmail.com> wrote:
>
>> I agree with Matt that a commercial plugin for IntelliJ would be mainly
>> targeted at people already using and preferring IntellJ, but this could be
>> an interesting market.
>>
>> As a personal note, I have tried CCW and found it a beautiful piece of
>> software, but the fact is that I simply prefer IntelliJ over Eclipse for
>> many big and small reasons.
>> It would be very difficult for me to leave IntelliJ, even if the current
>> version of La Clojure has a lot of problems.
>> I suspect that there is a sort of "rigid" demand for plugins for each of
>> the major IDEs, simply because of the investments people have put into them.
>>
>> I would be willing to pay a price in the suggested range even to access
>> the current alpha/beta version of the plugin, if it's better than the
>> current La Clojure build. Colin, if you are open and interested to this
>> kind of proposal you may contact me privately at francesco.bellomi(at)gmail.
>>
>> In any case, I wish you good luck with this project
>>
>> Francesco
>>
>> On Sunday, July 28, 2013 11:07:18 PM UTC+2, matt hoffman wrote:
>>>
>>> I've been watching your fork on Github for a while -- I've been excited
>>> to see that someone is actively working on La Clojure. I would pay for an
>>> IntelliJ plugin that was significantly better than La Clojure, but I'm also
>>> aware that I'd be paying just for my preference of IntelliJ over Eclipse
>>> for mixed Java/Clojure development. For pure Clojure development, Emacs
>>> would also be a contender. So that would be a really tough market.
>>> It would be a tough sell for my company, as well. They pay for IntelliJ
>>> Ultimate licenses, and if we told them we wanted to add in $200 more for a
>>> Clojure plugin, I'd have to be prepared to re-open the "just use Eclipse"
>>> argument.
>>>
>>> I'd also contribute to a Kickstarter, if you decided to go that route. I
>>> don't imagine you could make a living off of it that way, but you might be
>>> able to recoup some of your time.  A couple of developers in my company
>>> have talked about funding a bounty for nrepl integration alone.
>>>
>>>
>>>
>>> On Sat, Jul 27, 2013 at 3:20 PM, kovas boguta wrote:
>>>
 My suggestion: release as open source, and then try a kickstarter to
 see if there is interest in extending/continuing the project.

 IDE is a tough business. It has broken many. After all there is a
 reason intellij open-sourced the core in the first place.

 Frankly I think there is a bigger market in using clojure to develop
 better tools for other languages. If you have a nice intellij wrapper, then
 you have a huge advantage in developing tooling in general.

 On a side note, I would love to see intellij's widget library broken
 out in a more stand-alone way, so we can develop sexy clojure apps with
 pure jvm technology. Any thoughts on if that is technically doable?







 On Sat, Jul 27, 2013 at 4:54 AM, Colin Fleming 
 wrote:

> Hi all,
>
> I was planning to wait a little longer before going public, but since
> it's pretty relevant to the other IntelliJ thread going on at the moment I
> thought I'd jump in. For the last couple of months of happy unemployment
> I've been working on a fork of La Clojure which is now about 70% migrated
> to Clojure and significantly improved. It's a lot of work to develop a 
> tool
> like this, and one of the options I'm considering is starting a company to
> develop it as a commercial product - JetBrains have never maintained
> development of La Clojure very actively. I've been doing a little market
> research but there's really not much data around about whether there are
> enough people working with Clojure to sustain a product like that, and 
> also
> the community is currently very focused on open source.
>
> One problem is that the IDE space is already fairly fractured -
> there

Re: ANN: clj-tuple, efficient small collections

2013-08-25 Thread Jim - FooBar();

wow! very interesting stuff as always Zach...quick question:

I don't see Tuple implementing clojure.lang.Associative, so 'get' won't 
work right?


Jim

ps: I've got a project where I 'm working with a lot of 2-element 
vectors...I can't wait to try this out :)


On 25/08/13 03:38, Zach Tellman wrote:
I just pulled some code I wrote while trying to optimize 'memoize' 
into its own library: https://github.com/ztellman/clj-tuple.  It only 
has the one function, so I assume no one will need too much 
explanation.  However, there may still be room for performance 
improvements, so if anyone wants to take a stab, pull requests are 
welcome.


Zach
--
--
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 post.

To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google 
Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to clojure+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.


--
--
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups "Clojure" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


always function?

2013-08-25 Thread Christian Sperandio
Hi,

Is there a function builds a function that returns always the same value?

In coder words, this sort of function:
(defn always
  [v]
  (fn [& _] v))

If this function exists already, I prefer use it rather than reinvent the wheel 
:)

Christian

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: always function?

2013-08-25 Thread László Török
Hi,

(constantly 5)

will return a function that takes any number of args and always returns 5.

See http://clojuredocs.org/clojure_core/clojure.core/constantly.

Las


2013/8/25 Christian Sperandio 

> Hi,
>
> Is there a function builds a function that returns always the same value?
>
> In coder words, this sort of function:
> (defn always
>   [v]
>   (fn [& _] v))
>
> If this function exists already, I prefer use it rather than reinvent the
> wheel :)
>
> Christian
>
>  --
> --
> 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 post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
László Török

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: always function?

2013-08-25 Thread Christian Sperandio
Thanks, exactly what I want :)

Le 25 août 2013 à 13:40, László Török  a écrit :

> Hi,
> 
> (constantly 5)
> 
> will return a function that takes any number of args and always returns 5.
> 
> See http://clojuredocs.org/clojure_core/clojure.core/constantly.
> 
> Las
> 
> 
> 2013/8/25 Christian Sperandio 
> Hi,
> 
> Is there a function builds a function that returns always the same value?
> 
> In coder words, this sort of function:
> (defn always
>   [v]
>   (fn [& _] v))
> 
> If this function exists already, I prefer use it rather than reinvent the 
> wheel :)
> 
> Christian
> 
> 
> -- 
> -- 
> 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 post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> 
> -- 
> László Török
> 
> -- 
> -- 
> 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 post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: always function?

2013-08-25 Thread Cedric Greevey
(constantly x), I think, accepts various arities including unary.

user=> ((constantly 3) 5)
3
user=>



On Sun, Aug 25, 2013 at 7:34 AM, Christian Sperandio <
christian.speran...@gmail.com> wrote:

> Hi,
>
> Is there a function builds a function that returns always the same value?
>
> In coder words, this sort of function:
> (defn always
>   [v]
>   (fn [& _] v))
>
> If this function exists already, I prefer use it rather than reinvent the
> wheel :)
>
> Christian
>
>  --
> --
> 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 post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: always function?

2013-08-25 Thread Dave Della Costa
There is also identity, which returns what it was passed, which seems
closer to what you described initially.

=> (identity "foo")
"foo"


(2013/08/25 20:41), Christian Sperandio wrote:
> Thanks, exactly what I want :)
> 
> Le 25 aoűt 2013 ŕ 13:40, László Török  > a écrit :
> 
>> Hi,
>> 
>> (constantly 5)
>> 
>> will return a function that takes any number of args and always
>> returns 5.
>> 
>> See http://clojuredocs.org/clojure_core/clojure.core/constantly.
>> 
>> Las
>> 
>> 
>> 2013/8/25 Christian Sperandio > >
>> 
>> Hi,
>> 
>> Is there a function builds a function that returns always the
>> same value?
>> 
>> In coder words, this sort of function: (defn always [v] (fn [& _]
>> v))
>> 
>> If this function exists already, I prefer use it rather than 
>> reinvent the wheel :)
>> 
>> Christian
>> 
>> 
>> -- -- 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 post. To unsubscribe from this group,
>> send email to clojure+unsubscr...@googlegroups.com 
>>  For more options,
>> visit this group at http://groups.google.com/group/clojure?hl=en 
>> --- You received this message because you are subscribed to the
>> Google Groups "Clojure" group. To unsubscribe from this group and
>> stop receiving emails from it, send an email to
>> clojure+unsubscr...@googlegroups.com 
>> . For more
>> options, visit https://groups.google.com/groups/opt_out.
>> 
>> 
>> 
>> 
>> -- László Török
>> 
>> -- -- 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 post. To unsubscribe from this group,
>> send email to clojure+unsubscr...@googlegroups.com 
>>  For more options,
>> visit this group at http://groups.google.com/group/clojure?hl=en 
>> --- You received this message because you are subscribed to the
>> Google Groups "Clojure" group. To unsubscribe from this group and
>> stop receiving emails from it, send an email to
>> clojure+unsubscr...@googlegroups.com 
>> . For more options,
>> visit https://groups.google.com/groups/opt_out.
> 

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: always function?

2013-08-25 Thread Christian Sperandio
Thank you :)

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: always function?

2013-08-25 Thread Christian Sperandio
Not really.

The identity function returns the value. I want to have the function that 
returns the value.
constantly is the good answer for my needs.


Le 25 août 2013 à 13:57, Dave Della Costa  a écrit :

> There is also identity, which returns what it was passed, which seems
> closer to what you described initially.
> 
> => (identity "foo")
> "foo"

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


ANN Gemini 0.3.0

2013-08-25 Thread Christian Sperandio
Hi,

I continue improving the Gemini matching library.

I added the possibility to define the authorized validator with :all. Thus, 
instead of doing :authorized {:inv 1 :sub 1 :delete 1 :insert 1} you can write 
:authorized {:all 1}

And, I created a new namespace gemini.extended that provides function to search 
likeness between expressions.

More information on the project website https://github.com/chrix75/Gemini

Have fun.

Christian

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ANN: clj-tuple, efficient small collections

2013-08-25 Thread Zach Tellman
I don't think so, even the existence of all the Tuple* types are an 
implementation detail, and you'd need to hint it as the right one to get 
sane performance.  (nth t n) has good performance, you should prefer that.

On Saturday, August 24, 2013 8:15:40 PM UTC-7, Ben wrote:
>
> Are the element names .e0, .e1 etc. considered part of the public 
> interface of tuple objects?
>
>
> On Sat, Aug 24, 2013 at 7:38 PM, Zach Tellman 
> > wrote:
>
>> I just pulled some code I wrote while trying to optimize 'memoize' into 
>> its own library: https://github.com/ztellman/clj-tuple.  It only has the 
>> one function, so I assume no one will need too much explanation.  However, 
>> there may still be room for performance improvements, so if anyone wants to 
>> take a stab, pull requests are welcome.
>>
>> Zach
>>
>> -- 
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> Ben Wolfson
> "Human kind has used its intelligence to vary the flavour of drinks, which 
> may be sweet, aromatic, fermented or spirit-based. ... Family and social 
> life also offer numerous other occasions to consume drinks for pleasure." 
> [Larousse, "Drink" entry]
>
>  

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ANN: clj-tuple, efficient small collections

2013-08-25 Thread Zach Tellman
in my microbenchmarks I've found it to be consistently faster to unroll a 
fixed number of elements rather than iterate over them.  The difference 
might not be large enough to matter for many people's use cases, but the 
stated goal is to make a fast collection, so it's worthwhile to use the 
best known approach.

Currently tuples mimic lists, so conj adds onto the beginning, and does not 
return another tuple.  'rest', however, does return a tuple.  Also, since 
my intent wasn't to emulate vectors, 'get', 'assoc', and calling as 
function don't work with tuples.  This could obviously change, but I'd be 
curious to know why it makes a difference in someone's code.

Also, I played around with returning both a list or a vector in the 
unbounded case, but the performance is too different in each of these 
cases.  As I point out in the readme, vectors are *significantly* slower to 
create, which would make the performance of 'tuple' too inconsistent for my 
liking.  The TupleN solution I came up with was the best compromise I could 
think of.

Zach



On Saturday, August 24, 2013 10:47:11 PM UTC-7, Jozef Wagner wrote:
>
> Hi,
>
> I've did something similar for CLJS, see 
> http://dev.clojure.org/jira/browse/CLJS-453 and 
> https://groups.google.com/forum/#!searchin/clojure/arrayvector/clojure/yDvTRP0gYLA/Tb5MJC8Z0K8J
>
> In CLJS, it is comparable in performance to use array instead of 
> specialized type for each arity. Did you check if it is not the same in 
> Clojure?
>
> If I conjoin to the tuple, does it return a tuple too? Also instead of 
> tupleN, you could fall back to the PersistentVector.
>
> JW
>
>
> On Sun, Aug 25, 2013 at 4:38 AM, Zach Tellman 
> > wrote:
>
>> I just pulled some code I wrote while trying to optimize 'memoize' into 
>> its own library: https://github.com/ztellman/clj-tuple.  It only has the 
>> one function, so I assume no one will need too much explanation.  However, 
>> there may still be room for performance improvements, so if anyone wants to 
>> take a stab, pull requests are welcome.
>>
>> Zach
>>
>> -- 
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


lazy seq from reducers with core.async

2013-08-25 Thread Jozef Wagner
Hi,

A distinctive feature of reducers is that "reducing is a one-shot thing". 
The common understanding is that reducers are fast for cases where you want 
to process whole collection at once, but for infinite and lazy seqs, you 
have to use good old seqs.

With core.async, it is now easy to create a transformation which produces 
lazy seq from any reducible collection.

  (defn lazy-seq*
[reducible]
(let [c (chan)
  NIL (Object.)
  encode-nil #(if (nil? %) NIL %)
  decode-nil #(if (identical? NIL %) nil %)]
  (thread
   (reduce (fn [r v] (>!! c (encode-nil v))) nil reducible)
   (close! c))
  (take-while (complement nil?) (repeatedly #(decode-nil (http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Question on mapcat and its variable arity

2013-08-25 Thread ngieschen
I'm somewhat new to clojure and trying to understand mapcat, so apologies 
in advance if this is an embarrassingly elementary question.

mapcat's signature is (f & colls) which indicates to me I should be able to 
so something like (mapcat #(list (inc %)) [1 2 3] [4 5 6]). That is, 
doesn't the & indicate that I can pass in a variable number of colls? 
However, if I do, it crashes and burns, since internally it's calling 
(apply map #(list (inc %)) '([1 2 3] '[4 5 6])), which, as expected, throws 
an ArityException.

So, am I missing something or is mapcat's signature wrong? It seems to me 
it should be (f colls) and not (f & colls).

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Question on mapcat and its variable arity

2013-08-25 Thread Lee Spector

On Aug 25, 2013, at 5:42 PM, ngieschen wrote:
> 
> mapcat's signature is (f & colls) which indicates to me I should be able to 
> so something like (mapcat #(list (inc %)) [1 2 3] [4 5 6]). That is, doesn't 
> the & indicate that I can pass in a variable number of colls? However, if I 
> do, it crashes and burns, since internally it's calling (apply map #(list 
> (inc %)) '([1 2 3] '[4 5 6])), which, as expected, throws an ArityException.
> 
> So, am I missing something or is mapcat's signature wrong? It seems to me it 
> should be (f colls) and not (f & colls).

mapcat is happy with a variable number of args, but the function that you're 
mapping down those multiple args doesn't have the right arity.

Try:

(mapcat #(list (inc %1) (inc %2)) [1 2 3] [4 5 6])

 -Lee

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Question on mapcat and its variable arity

2013-08-25 Thread ngieschen
Ahh, of course. Ouch, that was embarrassingly elementary. Thanks.

On Sunday, August 25, 2013 3:13:12 PM UTC-7, Lee wrote:
>
>
> On Aug 25, 2013, at 5:42 PM, ngieschen wrote: 
> > 
> > mapcat's signature is (f & colls) which indicates to me I should be able 
> to so something like (mapcat #(list (inc %)) [1 2 3] [4 5 6]). That is, 
> doesn't the & indicate that I can pass in a variable number of colls? 
> However, if I do, it crashes and burns, since internally it's calling 
> (apply map #(list (inc %)) '([1 2 3] '[4 5 6])), which, as expected, throws 
> an ArityException. 
> > 
> > So, am I missing something or is mapcat's signature wrong? It seems to 
> me it should be (f colls) and not (f & colls). 
>
> mapcat is happy with a variable number of args, but the function that 
> you're mapping down those multiple args doesn't have the right arity. 
>
> Try: 
>
> (mapcat #(list (inc %1) (inc %2)) [1 2 3] [4 5 6]) 
>
>  -Lee

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: always function?

2013-08-25 Thread Dave Della Costa
That's what I get for posting late on a Sunday.  I see now I misread
your request as a desire for a function that always returns its
argument, but it's clear now what you were looking for and constantly is
exactly it.

Sorry for the noise!

(2013/08/25 21:02), Christian Sperandio wrote:
> Not really.
> 
> The identity function returns the value. I want to have the function that 
> returns the value.
> constantly is the good answer for my needs.
> 
> 
> Le 25 août 2013 à 13:57, Dave Della Costa  a écrit :
> 
>> There is also identity, which returns what it was passed, which seems
>> closer to what you described initially.
>>
>> => (identity "foo")
>> "foo"
> 

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Question on mapcat and its variable arity

2013-08-25 Thread John Mastro
On Aug 25, 2013, at 2:43 PM, ngieschen  wrote:

> I'm somewhat new to clojure and trying to understand mapcat, so apologies in 
> advance if this is an embarrassingly elementary question.
>
> mapcat's signature is (f & colls) which indicates to me I should be able to 
> so something like (mapcat #(list (inc %)) [1 2 3] [4 5 6]). That is, doesn't 
> the & indicate that I can pass in a variable number of colls? However, if I 
> do, it crashes and burns, since internally it's calling (apply map #(list 
> (inc %)) '([1 2 3] '[4 5 6])), which, as expected, throws an ArityException.

Try this:

(mapcat #(list (+ %1 %2)) [1 2 3] [4 5 6])

The function f needs to accept a number of arguments equal to the
number of colls.

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Converting project.clj to maven's pom.xml

2013-08-25 Thread Ryan Berdeen
Now that https://github.com/technomancy/leiningen/pull/454 is resolved, 
what's the right way to have lein generate a pom.xml that Maven can build? 

Is https://github.com/pallet/zi the way to go? How do I configure my 
project.clj so that it adds the plugin to the pom's  section, 
instead of adding a second ?

Thanks!

Ryan

On Thursday, June 7, 2012 5:53:40 PM UTC-4, Phil Hagelberg wrote:
>
> On Thu, Jun 7, 2012 at 2:52 PM, Joseph Smith 
> > 
> wrote: 
> > Doesn't "lein pom" do it? 
>
> Not yet, but it's planned: 
> https://github.com/technomancy/leiningen/pull/454 
>
> Happy to take a patch for it. 
>
> -Phil 
>

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ANN: clj-tuple, efficient small collections

2013-08-25 Thread Mikera
Good stuff Zach - I've certainly wanted something like this on various 
occasions. 

Some comments:
- core.matrix will also work with clj-tuple (because they support ISeq)
- If you made the tuples support IPersistentVector I think they would be 
even more useful: it's helpful I think to see tuples as specialised vectors
- vectorz-clj does something similar with specialised small types for 
primitive doubles (length 0 to 4) - recommended for small numerical vectors


On Sunday, 25 August 2013 10:38:25 UTC+8, Zach Tellman wrote:
>
> I just pulled some code I wrote while trying to optimize 'memoize' into 
> its own library: https://github.com/ztellman/clj-tuple.  It only has the 
> one function, so I assume no one will need too much explanation.  However, 
> there may still be room for performance improvements, so if anyone wants to 
> take a stab, pull requests are welcome.
>
> Zach
>

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: lazy seq from reducers with core.async

2013-08-25 Thread Mikera
Nice idea Jozef!

Hmmm this is another example of why nil-as-end-of-channel is a slightly 
problematic design decision for core.async: it makes this kind of code much 
more fiddly.

On Monday, 26 August 2013 01:47:14 UTC+8, Jozef Wagner wrote:
>
> Hi,
>
> A distinctive feature of reducers is that "reducing is a one-shot thing". 
> The common understanding is that reducers are fast for cases where you want 
> to process whole collection at once, but for infinite and lazy seqs, you 
> have to use good old seqs.
>
> With core.async, it is now easy to create a transformation which produces 
> lazy seq from any reducible collection.
>
>   (defn lazy-seq*
> [reducible]
> (let [c (chan)
>   NIL (Object.)
>   encode-nil #(if (nil? %) NIL %)
>   decode-nil #(if (identical? NIL %) nil %)]
>   (thread
>(reduce (fn [r v] (>!! c (encode-nil v))) nil reducible)
>(close! c))
>   (take-while (complement nil?) (repeatedly #(decode-nil (  
>   (def s (lazy-seq* (clojure.core.reducers/map inc (range
>  
>   (first s)
>  
>   (take 100 s)
>
> This approach can be also extended to produce chunked seqs and chan buffer 
> can also be used to further tune the performance.
>
> JW
>
>

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: lazy seq from reducers with core.async

2013-08-25 Thread Alan Busby
Here is something similar pulled from bagotricks "1.5.2", using Java's
linked blocking queue;
https://github.com/thebusby/bagotricks/blob/master/src/bagotricks.clj#L204-L238

It uses fold instead of reduce to run in parallel, so has a slightly
different use case than above.


On Mon, Aug 26, 2013 at 10:14 AM, Mikera wrote:

> Nice idea Jozef!
>
> Hmmm this is another example of why nil-as-end-of-channel is a
> slightly problematic design decision for core.async: it makes this kind of
> code much more fiddly.
>
>
> On Monday, 26 August 2013 01:47:14 UTC+8, Jozef Wagner wrote:
>>
>> Hi,
>>
>> A distinctive feature of reducers is that "reducing is a one-shot thing".
>> The common understanding is that reducers are fast for cases where you want
>> to process whole collection at once, but for infinite and lazy seqs, you
>> have to use good old seqs.
>>
>> With core.async, it is now easy to create a transformation which produces
>> lazy seq from any reducible collection.
>>
>>   (defn lazy-seq*
>> [reducible]
>> (let [c (chan)
>>   NIL (Object.)
>>   encode-nil #(if (nil? %) NIL %)
>>   decode-nil #(if (identical? NIL %) nil %)]
>>   (thread
>>(reduce (fn [r v] (>!! c (encode-nil v))) nil reducible)
>>(close! c))
>>   (take-while (complement nil?) (repeatedly #(decode-nil (>
>>   (def s (lazy-seq* (clojure.core.reducers/map inc (range
>>
>>   (first s)
>>
>>   (take 100 s)
>>
>> This approach can be also extended to produce chunked seqs and chan
>> buffer can also be used to further tune the performance.
>>
>> JW
>>
>>  --
> --
> 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 post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] optparse-clj: Functional GNU-style command line options parsing

2013-08-25 Thread gaz jones
Hey, i am the current maintainer of tools.cli - i have very little time to
make any changes to it at the moment (kids :) ). I'm not sure what the
process is for adding you as a developer or transferring ownership etc but
if I'm happy to do so as I have no further plans for working on it.

Thanks,
Gaz


On Sat, Aug 24, 2013 at 9:44 PM, guns  wrote:

> On Fri 23 Aug 2013 at 05:02:50PM -0700, Paul deGrandis wrote:
>
> > Guns,
> >
> > Have you signed a Clojure CA yet? I'd love to help get this merged
> > into tools.cli
>
> Okay, since there is interest, I will mail a CA on Monday morning.
>
> Paul, if you are a maintainer or committer of tools.cli, I would be
> happy to submit the patch to you.
>
> guns
>

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: lazy seq from reducers with core.async

2013-08-25 Thread Timothy Baldridge
Although this looks like it might work, it's not exactly a good idea. Look
at what you're doing inside the reducer, a call to >!! will block a OS
level thread until someone takes from the channel. Since reducers use
fork-join pools, I wouldn't be surprised if it caused some serious
side-effects. Since reducing over things like vectors and maps happen in
parallel, you could end up blocking unknown numbers of threads until these
seqs get realized. So the pool may go out and create more threads, just to
have those blocked by this code.  Either that, or the fork/join pool will
just clog up, keeping other reducers from running properly.


Timothy Baldridge


On Sun, Aug 25, 2013 at 8:43 PM, Alan Busby  wrote:

> Here is something similar pulled from bagotricks "1.5.2", using Java's
> linked blocking queue;
>
> https://github.com/thebusby/bagotricks/blob/master/src/bagotricks.clj#L204-L238
>
> It uses fold instead of reduce to run in parallel, so has a slightly
> different use case than above.
>
>
> On Mon, Aug 26, 2013 at 10:14 AM, Mikera wrote:
>
>> Nice idea Jozef!
>>
>> Hmmm this is another example of why nil-as-end-of-channel is a
>> slightly problematic design decision for core.async: it makes this kind of
>> code much more fiddly.
>>
>>
>> On Monday, 26 August 2013 01:47:14 UTC+8, Jozef Wagner wrote:
>>>
>>> Hi,
>>>
>>> A distinctive feature of reducers is that "reducing is a one-shot
>>> thing". The common understanding is that reducers are fast for cases where
>>> you want to process whole collection at once, but for infinite and lazy
>>> seqs, you have to use good old seqs.
>>>
>>> With core.async, it is now easy to create a transformation which
>>> produces lazy seq from any reducible collection.
>>>
>>>   (defn lazy-seq*
>>> [reducible]
>>> (let [c (chan)
>>>   NIL (Object.)
>>>   encode-nil #(if (nil? %) NIL %)
>>>   decode-nil #(if (identical? NIL %) nil %)]
>>>   (thread
>>>(reduce (fn [r v] (>!! c (encode-nil v))) nil reducible)
>>>(close! c))
>>>   (take-while (complement nil?) (repeatedly #(decode-nil (>>
>>>
>>>   (def s (lazy-seq* (clojure.core.reducers/map inc (range
>>>
>>>   (first s)
>>>
>>>   (take 100 s)
>>>
>>> This approach can be also extended to produce chunked seqs and chan
>>> buffer can also be used to further tune the performance.
>>>
>>> JW
>>>
>>>  --
>> --
>> 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 post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> --
> 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 post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: lazy seq from reducers with core.async

2013-08-25 Thread Alan Busby
On Mon, Aug 26, 2013 at 1:37 PM, Timothy Baldridge wrote:

> Since reducers use fork-join pools,


Reducers use multiple threads and fork-join pools when called with "fold"
on vectors (anything else?), not "reduce".
By making the single producer thread of the reducer block on writes, per
Jozef's code, he's making it act like a lazy-seq.

If fold was used, then something similar to the code snippet I provided may
be more appropriate.
It would really depend on the use-case though.

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Async loading of a big set of entries from a redis database?

2013-08-25 Thread Bastien
Hi all,

I'm playing with http://www.mapbox.com to build a map with 1.3M
markers.

The markers are stored in a redis database on heroku.

I'm learning Clojure, so my first attempt has been to use Carmine for
loading the entries and creating the javascript variable on the fly.

This works ok for a small (<1) number of markers:

  http://wlmmap.herokuapp.com/

But of course this does not scale well.

My next step is to make the process asynchronous so that an nearly
empty map displays immediately, and markers are progressively added
to the map.

I'm a bit lost where to start:

- shall I try to use a nodejs redis client then handle the async
  loading of markers (stored in the javascript variable) with
  core.async?

- shall I try to use the "aleph" library to create a channel where
  I collect the entries, then use shoreleave to create a defremote
  returning this channel?

- ... ?

As you guess from all the library-name-dropping, I've been traveling
around the web quite far but my overall knowledge of Clojure(Script)
is too weak at the moment to know the best direction.

If anyone can put me on the right track, or even show me some code
that solves this problem of loading a big database asynchronously
into a javascript variable, I'd appreciate this a lot!

Thanks in advance,

-- 
 Bastien

-- 
-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.