Core async / how to work around "No more than 1024 pending puts are allowed on a single channel"

2014-03-27 Thread Hanh Huynh Huu
Hi guys, 

I have an app that sometimes needs to put a lot of messages on a channel. 
The rate is not directly under my control - the messages come from the 
outside.

As a quick test, I wrote this snippet

(def c (chan (async/buffer 10240)))

(go
  (doseq [i (range 1024000)]
(>!! c i)))

and i hit this exception:
Exception in thread "async-dispatch-14" java.lang.AssertionError: Assert 
failed: No more than 1024 pending puts are allowed on a single channel. 
Consider using a windowed buffer.
(< (.size puts) impl/MAX-QUEUE-SIZE)

If I replace the buffer with a dropping buffer or a sliding buffer, it 
works but I can't afford to drop messages. However, I'd be fine with a 
larger buffer than 1024.
I also replaced the >!! with >! and async/put!, but the result is the same.

Is there a way to achieve my goal?

Thanks,
--h

-- 
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/d/optout.


Re: Clojure + BDD + TDD + Pairing...

2014-03-27 Thread Brian Muhia
Hi Marc,

tmux + emacs works fine with me.

Best, 
Brian

On Wednesday, 26 March 2014 17:58:48 UTC+3, Marc Bluemner wrote:
>
> I guess wie Need to Devide on a pairing method "wemux oremacs or whatever 
> else there is .I use emacs but am good with vim and tmux too. I would 
> prefer emacs as I'm switching  to it St the Moment  
> —
> Sent from Mailbox  for iPhone
>
>
> On Wed, Mar 26, 2014 at 2:57 PM, Marcus Blankenship 
> 
> > wrote:
>
>> Hi guys,
>>
>> I'm glad the idea of pairing to learn is interesting to you!  Any 
>> suggestions on how we proceed?
>>
>> Sent from my iPhone
>>  
>> On Mar 26, 2014, at 5:23 AM, Marc Bluemner 
>> > 
>> wrote:
>>
>>  Hahahah you saved your ass there Jason :) BDD is TDD with more focus on 
>> business value and Costomer interviews. I got a copy of BDD in action but 
>> Im a reviewer so I dont realy have it ;)
>>
>>
>> On Tuesday, March 25, 2014 4:45:32 PM UTC+1, Jason Felice wrote:
>>>
>>> I do TDD, even with my clojure (combined with repl-driven development). 
>>>  BDD, however, doesn't make a lot of sense in clojure-land.  If logic is 
>>> kept to pure functions as much as possible and state management kept to the 
>>> "outside" of the app (highly recommended), TDD becomes really fun and 
>>> managable without worrying about "things" & "behaviors".
>>>
>>> (I say this knowing that there are a dozen conflicting notions of BDD.)
>>>  
>>>
>>> On Tue, Mar 25, 2014 at 9:43 AM, Gilberto Garcia wrote:
>>>
  Hi Marcus,

 I'm also starting with Clojure and would like to find someone to pair 
 and to study Clojure together.

 Best regards,
 Gilberto



 On 03/25/2014 09:50 AM, Marc Bluemner wrote:
  
 Hey Marcus,  

 Im Marc from Germany! Im actualy learning Clojure and am trying to get 
 good at BDD, we are trying to implement it at work so practice would be 
 great. I must say Ive never done pair programming but Im realy eager to 
 try. SO if you like Im absolutly open for everything.

 Greetings Marc

 Am Mittwoch, 30. Oktober 2013 04:43:54 UTC+1 schrieb Marcus 
 Blankenship: 
>
> Hi Folks, 
>
> I’m a Clojure n00b, but am interested in finding another n00b who 
> aspires to learn Clojure, and do so using BDD / TDD practices through 
> regular pairing sessions.  I’ve found novice <-> novice pairing to be a 
> great way to ramp up on skills, but I don’t live near anyone who I can 
> pair 
> with.  
>
> I’m thinking that doing 3 1-hour sessions a week, for a month, would 
> give us a nice start.  Obviously, this would be remote pairing via 
> ScreenHero (or some other tool).
>
> Anyone interested?
>
> Best,
> Marcus
>
>  
> marcus blankenship 
> \\\ Partner, Problem Solver, Linear Thinker
> \\\ 541.805.2736 \ @justzeros \ skype:marcuscreo
> 
>   -- 
 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/d/optout.


   -- 
 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/d/optout.

>>>  
>>>   -- 
>> 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 subscrib

Re: Clojure + BDD + TDD + Pairing...

2014-03-27 Thread Brian Muhia
Hi Josh,
I'm interested in pairing as well. I'm also based in GMT+3.

Best,
- B

On Wednesday, 30 October 2013 10:23:58 UTC+3, Josh Kamau wrote:
>
> I can do it with you if we limit the hours to Saturday and sunday.
>
> I am a noob though i have 2 apps in production. (You can get alot done 
> without knowing the whole of clojure)
>
> I am in GMT  +3
>
> Thanks. 
>
>
> On Wed, Oct 30, 2013 at 6:43 AM, Marcus Blankenship 
> 
> > wrote:
>
>> Hi Folks,
>>
>> I’m a Clojure n00b, but am interested in finding another n00b who aspires 
>> to learn Clojure, and do so using BDD / TDD practices through regular 
>> pairing sessions.  I’ve found novice <-> novice pairing to be a great way 
>> to ramp up on skills, but I don’t live near anyone who I can pair with.  
>>
>> I’m thinking that doing 3 1-hour sessions a week, for a month, would give 
>> us a nice start.  Obviously, this would be remote pairing via ScreenHero 
>> (or some other tool).
>>
>> Anyone interested?
>>
>> Best,
>> Marcus
>>
>>
>> marcus blankenship
>> \\\ Partner, Problem Solver, Linear Thinker
>> \\\ 541.805.2736 \ @justzeros \ skype:marcuscreo
>>  
>>  -- 
>> -- 
>> 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/d/optout.


Re: generators...?

2014-03-27 Thread Tim
I'm fairly new to Clojure and this was a fun little exercise to try.

(def color-map (reduce #(assoc % (count %) %2) {} [:red :yellow :blue 
:green :purple]))

color-map
=> {4 :purple, 3 :green, 2 :blue, 1 :yellow, 0 :red}

(defn random-repeating-map
  ([coll-map] (random-repeating-map coll-map coll-map))
  ([coll-map new-coll-map]
   (if (seq new-coll-map)
 (let [ key-vec (into [] (keys new-coll-map))
idx-key (key-vec (rand-int (count key-vec)))]
   (cons (new-coll-map idx-key)
   (lazy-seq (random-repeating-map coll-map (dissoc new-coll-map 
idx-key) (random-repeating-map coll-map

(take 20 (random-repeating-map color-map))
=> (:blue :purple :yellow :red :green :purple :blue :red :yellow :green 
:red :purple :yellow :green :blue :green :blue :yellow :red :purple)

Step 4: Profit

On Wednesday, March 26, 2014 1:10:12 PM UTC-7, Gary Trakhman wrote:
>
> true, he did say 'or something that would be as useful', but lazy-seqs 
> are more useful :-).
>
>
> On Wed, Mar 26, 2014 at 4:08 PM, Ben Wolfson 
> > wrote:
>
>> "cycle" isn't really the same thing, though, at least if the OP really 
>> does require (for some reason) something that can be called repeatedly and 
>> get a different answer each time.
>>  
>>
>> On Wed, Mar 26, 2014 at 1:05 PM, Gary Trakhman 
>> 
>> > wrote:
>>
>>> cycle - http://clojuredocs.org/clojure_core/clojure.core/cycle
>>>
>>> And generally, this class of functionality is called lazy-seqs.
>>>
>>>
>>> On Wed, Mar 26, 2014 at 3:59 PM, Christopher Howard 
>>> 
>>> > wrote:
>>>
 Hi. I'm still fairly new to Clojure. I was wondering: What's the
 easiest way to make a generator (or something that would be as useful).
 In one application, I need something that will return a different color
 each time I call it - following a predefined list of colors, and
 starting over again at the beginning when colors are exhausted.

 --
 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/d/optout.

>>>
>>>  -- 
>>> 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/d/optout.
>>>
>>
>>
>>
>> -- 
>> 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 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/d/optout.
>>
>
>

-- 
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 th

om: state management considerations

2014-03-27 Thread rlewczuk
Hi, 

After playing a bit with om, I'm somewhat confused about state maintaining 
possibilities it offers. There is global application state and local 
component state.  I have some doubts about using local state as it seems to 
lead to troubles as soon as code grows a bit (I'm thinking about 
traditional widgets, eg. data table with editing capability - somewhat 
boring stuff, yet quite common in many cases). Most common approach to this 
seems to be to set up some local state and then use core.async channels for 
communication and updating global state asynchronousluy (go ...) blocks. 

My feeling is that it creates lots of places with application state which 
negates to some extent main premise of state handling by om. Do I need to 
use local state at all ? Are there any alternatives ? I'm thinking about 
using keyword namespacing in global state to separate concerns, for example 
viewed data table row could be kept as something like :d/current-row 
somewhere in global state ('d' stands for data) but when row editing starts 
:e/current-row appears and is used by input fields ('e' stands for 
editing). UI configuration (column descriptions etc.) would use 'u' prefix 
(eg. :u/columns) for example etc. 

My feeling is that keeping application state strictly in global state would 
make some things easier (testing+debugging UI components, recording user 
sessions in full detail by listening on :tx-listen etc.). But blindly 
following all-in-global state also can have its pitfalls that I'm not aware 
of (as cljs/reactjs/om newbie).


There are the following aspects of UI state as I see it:

- hardcoded UI config data (widget descriptions, column descriptions etc.);

- customizable UI config data (eg. skins and styles that application user 
can choose);

- UI code (function references sometimes bound somewhere to application 
state);

- UI state (eg. currently edited data, flags marking that data is being 
edited/viewed row being selected etc.)

- business data (fetched REST from backend);

- inherently stateful stuff (eg. core.async channels);

- etc. 


My question is: where would you recommend placing individual bits of 
config/data/state listed above (global state? local state? :opts ? global 
:shared ? etc.) ?

Regards,
rle


-- 
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/d/optout.


Re: Core async / how to work around "No more than 1024 pending puts are allowed on a single channel"

2014-03-27 Thread Tassilo Horn
Hanh Huynh Huu  writes:

> If I replace the buffer with a dropping buffer or a sliding buffer, it
> works but I can't afford to drop messages. However, I'd be fine with a
> larger buffer than 1024.  I also replaced the >!! with >! and
> async/put!, but the result is the same.
>
> Is there a way to achieve my goal?

The 1024 is defined as

  (def ^:const ^int MAX-QUEUE-SIZE 1024)

in namespace clojure.core.async.impl.protocols.  So you could do

  (in-ns 'clojure.core.async.impl.protocols)
  (def ^:const ^int MAX-QUEUE-SIZE 2048)
  (in-ns 'your.own.ns)

to override it.  However, I don't know if that's a good idea...

Bye,
Tassilo

-- 
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/d/optout.


Re: Core async / how to work around "No more than 1024 pending puts are allowed on a single channel"

2014-03-27 Thread Jozef Wagner
If you cannot drop messages, just increase the size of a channel buffer
(the argument to the chan function). If the channel buffer is full, puts
are placed in a channels 'put buffer', which is limited to 1024 puts.

Jozef


On Thu, Mar 27, 2014 at 3:00 AM, Hanh Huynh Huu  wrote:

> Hi guys,
>
> I have an app that sometimes needs to put a lot of messages on a channel.
> The rate is not directly under my control - the messages come from the
> outside.
>
> As a quick test, I wrote this snippet
>
> (def c (chan (async/buffer 10240)))
>
> (go
>   (doseq [i (range 1024000)]
> (>!! c i)))
>
> and i hit this exception:
> Exception in thread "async-dispatch-14" java.lang.AssertionError: Assert
> failed: No more than 1024 pending puts are allowed on a single channel.
> Consider using a windowed buffer.
> (< (.size puts) impl/MAX-QUEUE-SIZE)
>
> If I replace the buffer with a dropping buffer or a sliding buffer, it
> works but I can't afford to drop messages. However, I'd be fine with a
> larger buffer than 1024.
> I also replaced the >!! with >! and async/put!, but the result is the same.
>
> Is there a way to achieve my goal?
>
> Thanks,
> --h
>
>  --
> 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/d/optout.
>

-- 
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/d/optout.


dependencies from github

2014-03-27 Thread t x
Hi,

## Context:

  * I'm using lein.
  * In my project.clj, I have something like:

:dependencies[ [org.clojure/clojure "1.5.1"]
  [org.clojure/clojurescript "0.0.-2173"]
  [not-really-trusted-package "version"]]

  Now, I don't like pulling not-really-trusted-package, which can
change under me. Instead I'd prefer to:

  (1) git fork the not-really-trusted package to
github/txrev319/not-really-trusted
  (2) have lein pull from github/txrev319/not-really-trusted

## Question:

  How do I achieve the above?

Thanks!

(I still don't trust the package, but atleast I want to use the same
untrusted package every time.)

-- 
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/d/optout.


Re: dependencies from github

2014-03-27 Thread Ray Miller
Have you considered pushing your build of the package to Clojars under
the org.clojars.USERNAME group?

Ray.

On 27 March 2014 09:16, t x  wrote:
> Hi,
>
> ## Context:
>
>   * I'm using lein.
>   * In my project.clj, I have something like:
>
> :dependencies[ [org.clojure/clojure "1.5.1"]
>   [org.clojure/clojurescript "0.0.-2173"]
>   [not-really-trusted-package "version"]]
>
>   Now, I don't like pulling not-really-trusted-package, which can
> change under me. Instead I'd prefer to:
>
>   (1) git fork the not-really-trusted package to
> github/txrev319/not-really-trusted
>   (2) have lein pull from github/txrev319/not-really-trusted
>
> ## Question:
>
>   How do I achieve the above?
>
> Thanks!
>
> (I still don't trust the package, but atleast I want to use the same
> untrusted package every time.)
>
> --
> 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/d/optout.

-- 
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/d/optout.


Re: dependencies from github

2014-03-27 Thread David Powell
If you checkout the package to checkouts/not-really-trusted-package, then
that version will automatically be used instead.
https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#checkout-dependencies

-- 
Dave



On Thu, Mar 27, 2014 at 9:16 AM, t x  wrote:

> Hi,
>
> ## Context:
>
>   * I'm using lein.
>   * In my project.clj, I have something like:
>
> :dependencies[ [org.clojure/clojure "1.5.1"]
>   [org.clojure/clojurescript "0.0.-2173"]
>   [not-really-trusted-package "version"]]
>
>   Now, I don't like pulling not-really-trusted-package, which can
> change under me. Instead I'd prefer to:
>
>   (1) git fork the not-really-trusted package to
> github/txrev319/not-really-trusted
>   (2) have lein pull from github/txrev319/not-really-trusted
>
> ## Question:
>
>   How do I achieve the above?
>
> Thanks!
>
> (I still don't trust the package, but atleast I want to use the same
> untrusted package every time.)
>
> --
> 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/d/optout.
>

-- 
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/d/optout.


Re: dependencies from github

2014-03-27 Thread David Powell
On Thu, Mar 27, 2014 at 10:23 AM, David Powell  wrote:

> If you checkout the package to checkouts/not-really-trusted-package, then
> that version will automatically be used instead.
>
> https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#checkout-dependencies
>

(Though this is intended more as a local developer convenience rather than
something that you would want to use in a public project.  A private
clojars build as Ray suggested above might be more appropriate)

-- 
Dave

-- 
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/d/optout.


Re: dependencies from github

2014-03-27 Thread Aaron Cohen
I think you have 1 minor misunderstanding about how lein is working here.

Lein isn't checking "not-really-trusted-package" out of github, it's
retrieving the corresponding "artifact" from a maven-style repository.

If "version" doesn't end in "-SNAPSHOT", then lein (deferring to the way
maven works) will retrieve that dependency to your local
$HOME/.m2/repository/not-really-trusted-package/version directory, and
never update it again (because it doesn't have a SHAPSHOT suffix).

In addition, all of the repositories that lein is configured with by
default have a policy of never updating non-SNAPSHOT versions, so it's not
really possible for that artifact to change out from under you. That's the
whole point of the maven/lein "repeatable builds" philosophy.

--Aaron


On Thu, Mar 27, 2014 at 5:16 AM, t x  wrote:

> Hi,
>
> ## Context:
>
>   * I'm using lein.
>   * In my project.clj, I have something like:
>
> :dependencies[ [org.clojure/clojure "1.5.1"]
>   [org.clojure/clojurescript "0.0.-2173"]
>   [not-really-trusted-package "version"]]
>
>   Now, I don't like pulling not-really-trusted-package, which can
> change under me. Instead I'd prefer to:
>
>   (1) git fork the not-really-trusted package to
> github/txrev319/not-really-trusted
>   (2) have lein pull from github/txrev319/not-really-trusted
>
> ## Question:
>
>   How do I achieve the above?
>
> Thanks!
>
> (I still don't trust the package, but atleast I want to use the same
> untrusted package every time.)
>
> --
> 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/d/optout.
>

-- 
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/d/optout.


Re: Garden, Thorn - Looking for contributors

2014-03-27 Thread Joel Holdbrooks
I've answered this question numerous times and am convinced I need to write 
a blog post so I can just drop a link.

In general the biggest win is that you can use Clojure and all of the 
facilities therein to write more sophisticated stylesheets. Large CSS 
codebases are notoriously hard to manage and require a lot of discipline to 
get right. If you're not writing a lot of CSS it isn't necessarily a big 
win.

On Tuesday, March 25, 2014 5:42:45 PM UTC-7, Daniel wrote:
>
> I wonder what is so bad about pure CSS. Don't get me wrong - I do 
> appreciate projects like these.

-- 
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/d/optout.


Re: Garden, Thorn - Looking for contributors

2014-03-27 Thread Joel Holdbrooks
Thanks! I'll be in touch.

On Tuesday, March 25, 2014 1:54:23 PM UTC-7, Alan Moore wrote:
>
> Joel,
>
> Count me in...
>
> You can contact me offline at kahunamoore  coopsource  org
>
> Thanks for this library!
>
> Alan
>
>
> On Tuesday, March 25, 2014 12:33:15 PM UTC-7, Julien wrote:
>>
>> Hi Joel,
>>
>> thanks for your great work on garden! Definitively helping me every day.
>>
>> Can you share what you have in mind regarding CSSOM integration? It 
>> certainly opens cool perspective and I'm curious how you see it fit with 
>> garden. I would be interested in giving you a hand here.
>> Maybe a github issue would help start discussions?
>>
>> Julien
>>
>> Le samedi 22 mars 2014 22:41:04 UTC-3, Joel Holdbrooks a écrit :
>>>
>>> Greetings everyone,
>>>
>>> About a year ago I began working on Garden and in the short time the 
>>> library has been around it's grown a bit. Although many folks seem to be 
>>> interested in it, there's certainly not as much adoption of the library as 
>>> I'd like to see. Sass, Less, and (god help us) pure CSS still appear to be 
>>> the default choices for many people writing web applications in Clojure.
>>>
>>> This is something I'd like to change... but I need *your* help!
>>>
>>> No, no. Put down the phone. Don't look for a KickStarter URL. It's 
>>> nothing like that.
>>>
>>> How you can help Garden
>>>
>>> I'm looking for individuals who are interested in the following:
>>>
>>>
>>>- improving the compiler code
>>>- improving/extending existing API's
>>>- building an interface to the CSSOM
>>>
>>> I'm also open to good 'ol fashioned suggestions, pain points you've 
>>> experienced using the library, or flat out letting me know what it would 
>>> take to get you to choose Garden over the alternatives for your next 
>>> project.
>>>
>>> How you can help Thorn
>>>
>>> Thorn is very young project and has no official release yet. So what is 
>>> it? At the moment it's the beginnings of a Sass Parse Tree transformer; 
>>> something that will take CSS/SCSS/Sass code and give you Garden code. 
>>> There's a lot of fabulous libraries available in Sass and I'm sure it's a 
>>> big factor when choosing how to go about CSS generation.
>>>
>>> I'm looking for individuals who are interested in the following:
>>>
>>>
>>>- accurately transforming CSS/SCSS/Sass to real Clojure code 
>>>targeting Garden
>>>- accurately transforming Less to real Clojure code targeting Garden
>>>
>>> Why?
>>>
>>> I deeply believe that being able to author CSS in Clojure or 
>>> ClojureScript is a key piece to having an extremely compelling story for 
>>> web application development in Clojure. Being able to *program* CSS and 
>>> not just *preprocess* is a big advantage over existing tools. Being 
>>> able to use all of Clojure everywhere has astounding possibilities.
>>>
>>>
>>> If any of this sounds interesting to you please get in contact with me 
>>> or reply here. I will also be in San Francisco tomorrow until Tuesday for 
>>> Clojure/West if you'd like to discuss these items in person.
>>>
>>>
>>> Truly,
>>>
>>> Joel
>>>
>>

-- 
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/d/optout.


updating the last member

2014-03-27 Thread Andy Smith
Hi, 

(1) 
I'm sure there must be a simpler way to update the last element of a vector 
other than dec and count :

(let [xs [1 2 3]] (assoc xs (dec (count xs)) 4))

This gets messy when updating vectors in nested data structures :

(update-in [1 [1 2 [1 2 3]]] [1 2] #(assoc % (dec (count %)) 5))

So, what am I doing wrong? 

P.S. I know I could reverse the order of the data in the lists (i.e. 
probably changing to lists rather than vectors for conj-ing purposes), but 
im interested in vectors specifically.

Thanks 

Andy

-- 
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/d/optout.


Re: updating the last member

2014-03-27 Thread Andy Smith
P.S. in the above, I am assuming that the length of the leaf vector [1 2 3] 
is not known :

i.e. I cant call 

(assoc-in [1 [1 2 [1 2 3]]] [1 2 2] 5)

-- 
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/d/optout.


core.async threadpool size

2014-03-27 Thread icamts
Hi all,
quite a funny question. Thread pool size in core.async is twice the number 
of processors plus 42.

https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/impl/exec/threadpool.clj
 

42? The question is:

1) should it be 4 or 2?
2) 42 is the response to life, universe and everything
3) for some technical reason 42 is also a good minimum number for a thread 
pool

Luca

-- 
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/d/optout.


Re: updating the last member

2014-03-27 Thread Andy Smith
P.P.S

My assumption that I could use lists fails because lists arent associative 
so the following doesnt work either :

(let [xs '(1 2 3)] (assoc xs 0 2))

-- 
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/d/optout.


Re: core.async threadpool size

2014-03-27 Thread Ben Mabey
I asked Timothy Baldridge about this on IRC when the change was made 
that added 42 and this was the reply I got:


we're trying to strike a balance there, we don't want people to do IO 
inside a go block, but if they have to we'd don't want it to totally 
stall out.


Here is the full conversation:

http://clojure-log.n01se.net/date/2013-08-29.html#15:45a

-Ben

On 3/27/14, 8:55 AM, icamts wrote:

Hi all,
quite a funny question. Thread pool size in core.async is twice the 
number of processors plus 42.


https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/impl/exec/threadpool.clj 



42? The question is:

1) should it be 4 or 2?
2) 42 is the response to life, universe and everything
3) for some technical reason 42 is also a good minimum number for a 
thread pool


Luca
--
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/d/optout.


--
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/d/optout.


Re: updating the last member

2014-03-27 Thread Mauricio Aldazosa
Try something like this:

(let [xs [1 2 3]]
(conj (pop xs) 4))

Cheers,
Mauricio

-- 
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/d/optout.


Re: creating a map

2014-03-27 Thread Armando Blancas
To add a little, into is generic and has no special treatment if the 
collection is a map, but works with maps if the elements are vectors 
because map associations of key-value pairs are a subclass of vector. The 
other way around:
user=> (for [elem {:foo :bar}] elem)
([:foo :bar]) ; extracts :foo -> :bar as a vector

On Wednesday, March 26, 2014 5:51:09 PM UTC-7, Robert Marianski wrote:

> into expects that because it is implemented with conj.
>
> > (conj {} [:foo :bar])
> {:foo :bar}
>
>
> On Wednesday, March 26, 2014 4:41:16 PM UTC-4, Michael Gardner wrote:
>>
>> For reasons unclear to me, (into {} ...) expects a sequence of 2-element 
>> *vectors*, not just 2-element collections. partition returns a seq of 
>> lists, not vectors, which is why you're getting that exception. You could 
>> try (into {} (map vec (partition 2 2 "12"))) instead. 
>>
>> On Mar 26, 2014, at 15:36 , Andy Smith  wrote: 
>>
>> > Hi all, 
>> > 
>> > I was wondering why this doesn't create a map 1 -> 2 : 
>> > 
>> > (into {} (partition 2 2 "12")) 
>> > 
>> > Must be yet another misunderstanding of mine. 
>> > 
>> > Thanks 
>> > 
>> > Andy 
>> > 
>> > -- 
>> > 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/d/optout. 
>>
>>

-- 
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/d/optout.


Re: core.async threadpool size

2014-03-27 Thread icamts
Thank you Ben.

Can we speculate on a go-off macro? Like in agents send / send-off to have 
go-off blocks executed by a cached thread pool executor?

Luca

Il giorno giovedì 27 marzo 2014 16:01:16 UTC+1, Ben Mabey ha scritto:
>
>  I asked Timothy Baldridge about this on IRC when the change was made 
> that added 42 and this was the reply I got:
>
>we're trying to strike a balance there, we don't want people to do IO 
> inside a go block, but if they have to we'd don't want it to totally stall 
> out.
>
> Here is the full conversation:
>
> http://clojure-log.n01se.net/date/2013-08-29.html#15:45a
>
> -Ben
>
> On 3/27/14, 8:55 AM, icamts wrote:
>  
> Hi all, 
> quite a funny question. Thread pool size in core.async is twice the number 
> of processors plus 42.
>
>  
> https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/impl/exec/threadpool.clj
>  
>
>  42? The question is:
>
>  1) should it be 4 or 2?
> 2) 42 is the response to life, universe and everything
> 3) for some technical reason 42 is also a good minimum number for a thread 
> pool
>
>  Luca
>  -- 
> 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/d/optout.
>
>
> 

-- 
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/d/optout.


Re: core.async threadpool size

2014-03-27 Thread Ben Mabey
If you want or need to block in a go-block then you should use the 
`thread` macro instead of the `go` macro.  A thread macro block will be 
ran in a cached thread pool as you seem to be wanting:


https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L379

Just note that you will need to use the blocking CSP operator variants, 
e.g. 

-Ben

On 3/27/14, 9:24 AM, icamts wrote:

Thank you Ben.

Can we speculate on a go-off macro? Like in agents send / send-off to 
have go-off blocks executed by a cached thread pool executor?


Luca

Il giorno giovedì 27 marzo 2014 16:01:16 UTC+1, Ben Mabey ha scritto:

I asked Timothy Baldridge about this on IRC when the change was
made that added 42 and this was the reply I got:

   we're trying to strike a balance there, we don't want people to
do IO inside a go block, but if they have to we'd don't want it to
totally stall out.

Here is the full conversation:

http://clojure-log.n01se.net/date/2013-08-29.html#15:45a


-Ben

On 3/27/14, 8:55 AM, icamts wrote:

Hi all,
quite a funny question. Thread pool size in core.async is twice
the number of processors plus 42.


https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/impl/exec/threadpool.clj




42? The question is:

1) should it be 4 or 2?
2) 42 is the response to life, universe and everything
3) for some technical reason 42 is also a good minimum number for
a thread pool

Luca
-- 
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/d/optout
.


--
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/d/optout.


--
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/d/optout.


Re: updating the last member

2014-03-27 Thread Jozef Wagner
Calling count on vector is a constant time operation, so I think (dec
(count v)) is an acceptable and even idiomatic in this case. Make it a
function if it is too verbose for you.

(let [assoc-last #(assoc % (dec (count %)) %2) ] (update-in [1 [1 2 [1 2
3]]] [1 2] #(assoc-last % 5)))

Jozef


On Thu, Mar 27, 2014 at 3:49 PM, Andy Smith wrote:

> Hi,
>
> (1)
> I'm sure there must be a simpler way to update the last element of a
> vector other than dec and count :
>
> (let [xs [1 2 3]] (assoc xs (dec (count xs)) 4))
>
> This gets messy when updating vectors in nested data structures :
>
> (update-in [1 [1 2 [1 2 3]]] [1 2] #(assoc % (dec (count %)) 5))
>
> So, what am I doing wrong?
>
> P.S. I know I could reverse the order of the data in the lists (i.e.
> probably changing to lists rather than vectors for conj-ing purposes), but
> im interested in vectors specifically.
>
> Thanks
>
> Andy
>
> --
> 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/d/optout.
>

-- 
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/d/optout.


Re: dependencies from github

2014-03-27 Thread Phil Hagelberg
On Thursday, March 27, 2014 7:16:36 AM UTC-7, Aaron Cohen wrote:
> If "version" doesn't end in "-SNAPSHOT", then lein (deferring to the way 
maven works)
> will retrieve that dependency to your local 
$HOME/.m2/repository/not-really-trusted-package/version
> directory, and never update it again (because it doesn't have a SHAPSHOT 
suffix).

This is correct; Clojars had a policy change a while back to completely ban 
re-deploys to the same non-snapshot version. If you pull something down 
from Clojars and inspect the jar file, you can rely on always getting the 
same version back in the future, barring a break-in to the server. If 
that's the threat model you're worried about, you would need to check the 
signatures on the jar with `lein deps :verify`, but that functionality is 
somewhat immature at the moment.

-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/d/optout.


Re: core.async threadpool size

2014-03-27 Thread icamts
Thank you again Ben, now it is more clear.

Luca

Il giorno giovedì 27 marzo 2014 16:43:51 UTC+1, Ben Mabey ha scritto:
>
>  If you want or need to block in a go-block then you should use the 
> `thread` macro instead of the `go` macro.  A thread macro block will be ran 
> in a cached thread pool as you seem to be wanting:
>
>
> https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L379
>
> Just note that you will need to use the blocking CSP operator variants, 
> e.g. 
> -Ben
>
> On 3/27/14, 9:24 AM, icamts wrote:
>  
> Thank you Ben. 
>
>  Can we speculate on a go-off macro? Like in agents send / send-off to 
> have go-off blocks executed by a cached thread pool executor?
>
>  Luca
>
> Il giorno giovedì 27 marzo 2014 16:01:16 UTC+1, Ben Mabey ha scritto: 
>>
>>  I asked Timothy Baldridge about this on IRC when the change was made 
>> that added 42 and this was the reply I got:
>>
>>we're trying to strike a balance there, we don't want people to do IO 
>> inside a go block, but if they have to we'd don't want it to totally stall 
>> out.
>>
>> Here is the full conversation:
>>
>> http://clojure-log.n01se.net/date/2013-08-29.html#15:45a
>>
>> -Ben
>>
>> On 3/27/14, 8:55 AM, icamts wrote:
>>  
>> Hi all, 
>> quite a funny question. Thread pool size in core.async is twice the 
>> number of processors plus 42.
>>
>>  
>> https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/impl/exec/threadpool.clj
>>  
>>
>>  42? The question is:
>>
>>  1) should it be 4 or 2?
>> 2) 42 is the response to life, universe and everything
>> 3) for some technical reason 42 is also a good minimum number for a 
>> thread pool
>>
>>  Luca
>>  -- 
>> 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/d/optout.
>>
>>
>>   -- 
> 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/d/optout.
>
>
> 

-- 
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/d/optout.


split maps contained in a file

2014-03-27 Thread emptya45
Hi, 

I have a Clojure file that contains two maps.

{:a 1 :b 2}
{:c 3 :d 4} 

I would like to read both maps as Clojure data structures, but if I:

(read-string (slurp maps.clj)) 

Only the first map is returned. 

I would like to read the file and split or partition the maps and hold onto 
them as two separate map data structures. 

Many Thanks

Mr Empty

-- 
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/d/optout.


Re: How did you learn Clojure?

2014-03-27 Thread Marcus Blankenship
Awesome, thanks for the advice.  I need to find something I've written and 
translate it to Clojure...
On Mar 26, 2014, at 7:14 PM, gaz jones  wrote:

> A technique I use whenever I need to learn a new language is to write the 
> same application I already have in another language.  I generally choose 
> downloading nzbs from usenet as it can involve a number of interesting 
> programming techniques, at least enough to give you a pretty good idea of how 
> a language handles things like:
> 
> * threading and work queues (downloading files concurrently)
> * socket io (writing a simple nntp client)
> * xml processing (parsing nzb files)
> * binary encoding/decoding (yenc implementation)
> * curses style ui
> * web ui
> * command line arguments
> * configuration
> * signal handling
> * testing (haha kidding)
> 
> TBH I usually get about 50% of the way through and have enough of a handle on 
> the language at that point to abandon my efforts and move on.
> 
> On Wed, Mar 26, 2014 at 7:22 PM, Daniel Higginbotham  
> wrote:
> Chiming in a bit late, but here was my path:
> 
> * Read "Land of Lisp" by Conrad Barski. This was my first real contact with 
> lisp and functional programming. I found it challenging, but the book is 
> well-written and the technique of teaching through writing games was perfect 
> for me. It uses common lisp which is almost baroque compared to Clojure, but 
> it was helpful later in getting a better sense of Clojure's roots. Also, most 
> of the classic lisp books out there use common lisp
> * Tried to write my own web-based game using common lisp. This was true fun 
> and I learned a ton
> * Read "On Lisp" by Paul Graham. It is an excellent book
> * Was introduced to Clojure through a talk given by Alan Dipert at my 
> workplace
> * Learned Clojure by skipping around Clojure in Action, Programming Clojure, 
> and Clojure Programming. Settled on Clojure Programming.
> * projecteuler.net has been a good help
> * I've been teaching Clojure to folks at work, which forces me to deeply 
> understand the material
> * At the same time, I've kept building little web apps to solidify my 
> knowledge. One of them, http://gratefulplace.com, is actually used :)
> 
> I feel like I know enough to get stuff done, but there's still so much more 
> to learn. Most recently I've been brushing up on math/logic so that I can 
> better understand the more mathy texts whenever I encounter them.
> 
> 
> On Thursday, March 20, 2014 9:08:41 PM UTC-4, Marcus Blankenship wrote:
> Hi Folks, 
> 
> I'm a post technical PM who's fascinated by Clojure, and want to learn it, 
> but am having a hard time without a "real" project to work on. It's actually 
> excited me so much I'm considering hanging up my PM hat and diving back in 
> the "programmer pool" again! 
> 
> My problem appears to be 1) focus, and 2) fear. Focus because I can't (yet) 
> earn a living on a clojure project, so it must be done during "off hours". 
> Fear because it's harder and more different than the old OO languages I've 
> used in the past. 
> 
> So I'm curious: how did you learn Clojure well enough to be proficient with 
> it, or how are you working on learning it? 
> 
> Anyone else facing the focus + fear dilemma? 
> 
> Sent from my iPhone
> 
> -- 
> 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/d/optout.
> 
> 
> -- 
> 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/d/optout.

Best,
Marcus

Marcus Blankenship
\\\ Problem Solver, Linear Thinker
\\\ 541.805.2736 \ @justzeros \ skype:marcuscreo

-- 
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 

Re: split maps contained in a file

2014-03-27 Thread Mauricio Aldazosa
Slurp returns one big string, in this case (assuming you have one map for
each line) you can use line-seq:

user> (with-open [rdr (clojure.java.io/reader "file-with-maps")]
(doall
 (map read-string (line-seq rdr

({:a 1, :b 2} {:c 3, :d 4})

Cheers,
Mauricio

-- 
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/d/optout.


[Video] Game development in Clojure (with play-clj)

2014-03-27 Thread James Trunk
Hi everyone,

I thought some of you might be interested to watch my screencast about game 
development in Clojure with 
play-clj
.

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 - 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/d/optout.


Re: updating the last member

2014-03-27 Thread Mark Engelberg
Or you could write your own custom version of update-in that recognizes the
keyword ::last to have a special meaning, so you could do:

(update-in [1 2 ::last 1 ::last] ...)


On Thu, Mar 27, 2014 at 8:57 AM, Jozef Wagner wrote:

> Calling count on vector is a constant time operation, so I think (dec
> (count v)) is an acceptable and even idiomatic in this case. Make it a
> function if it is too verbose for you.
>
> (let [assoc-last #(assoc % (dec (count %)) %2) ] (update-in [1 [1 2 [1 2
> 3]]] [1 2] #(assoc-last % 5)))
>
> Jozef
>
>
> On Thu, Mar 27, 2014 at 3:49 PM, Andy Smith 
> wrote:
>
>> Hi,
>>
>> (1)
>> I'm sure there must be a simpler way to update the last element of a
>> vector other than dec and count :
>>
>> (let [xs [1 2 3]] (assoc xs (dec (count xs)) 4))
>>
>> This gets messy when updating vectors in nested data structures :
>>
>> (update-in [1 [1 2 [1 2 3]]] [1 2] #(assoc % (dec (count %)) 5))
>>
>> So, what am I doing wrong?
>>
>> P.S. I know I could reverse the order of the data in the lists (i.e.
>> probably changing to lists rather than vectors for conj-ing purposes), but
>> im interested in vectors specifically.
>>
>> Thanks
>>
>> Andy
>>
>> --
>> 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/d/optout.
>>
>
>  --
> 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/d/optout.
>

-- 
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/d/optout.


anyone in Santa Cruz?

2014-03-27 Thread Brian Craft
Looking for clojure users in the Santa Cruz, Ca area who are interested in 
a meetup, study group, etc.

-- 
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/d/optout.


Re: Concurrency, Parallelism, and State. And Zombies.

2014-03-27 Thread Gary Johnson
Great job on such a tricky chapter. I particularly enjoyed the hilarious 
examples in the spirit of Learn You a Haskell for Great Good.

  ~Gary

On Wednesday, March 26, 2014 9:45:38 AM UTC-4, Daniel Higginbotham wrote:
>
> I've added a new chapter to Clojure for the Brave and True, "Concurrency, 
> Parallelism, and State. And 
> Zombies." 
> Here's an excerpt:
>
> ===
> In this chapter you'll learn what concurrency and parallelism are and why 
> they matter. You'll learn about the challenges you'll face when writing 
> parallel programs and about how Clojure's design helps to mitigate them. 
> Finally, you'll learn a big boatload of tools and techniques for writing 
> parallel programs yourself, including: futures, promises, delays, atoms, 
> refs, vars, pmap, and core.reducers. Also, there will be zombies.
> ===
>
> I hope you all find it useful and entertaining :)
>
> Daniel
>

-- 
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/d/optout.


Re: dependencies from github

2014-03-27 Thread dgrnbrg
Voom is a Lein plugin that lets you depend on a repository and pins you to a 
specific commit. It also provides tools manage systems spanning multiple repos. 
You can find it here: https://github.com/LonoCloud/lein-voom and see the video 
from clojure/west here: 
https://m.youtube.com/watch?v=axztcYJUN4I&list=PLZdCLR02grLp__wRg5OTavVj4wefg69hM

-- 
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/d/optout.


Re: updating the last member

2014-03-27 Thread Jozef Wagner
(defn update-in*
  [m [k & ks] f & args]
  (let [k (if (and (instance? clojure.lang.Indexed m)
   (integer? k)
   (neg? k))
(+ (count m) k)
k)]
(if ks
(assoc m k (apply update-in* (get m k) ks f args))
  (assoc m k (apply f (get m k) args)


(update-in* [1 [1 2 [1 2 3]]] [-1 -1 -1] (constantly 5))

https://gist.github.com/wagjo/9813500


On Thu, Mar 27, 2014 at 6:17 PM, Mark Engelberg wrote:

> Or you could write your own custom version of update-in that recognizes
> the keyword ::last to have a special meaning, so you could do:
>
> (update-in [1 2 ::last 1 ::last] ...)
>
>
> On Thu, Mar 27, 2014 at 8:57 AM, Jozef Wagner wrote:
>
>> Calling count on vector is a constant time operation, so I think (dec
>> (count v)) is an acceptable and even idiomatic in this case. Make it a
>> function if it is too verbose for you.
>>
>> (let [assoc-last #(assoc % (dec (count %)) %2) ] (update-in [1 [1 2 [1 2
>> 3]]] [1 2] #(assoc-last % 5)))
>>
>> Jozef
>>
>>
>> On Thu, Mar 27, 2014 at 3:49 PM, Andy Smith > > wrote:
>>
>>> Hi,
>>>
>>> (1)
>>> I'm sure there must be a simpler way to update the last element of a
>>> vector other than dec and count :
>>>
>>> (let [xs [1 2 3]] (assoc xs (dec (count xs)) 4))
>>>
>>> This gets messy when updating vectors in nested data structures :
>>>
>>> (update-in [1 [1 2 [1 2 3]]] [1 2] #(assoc % (dec (count %)) 5))
>>>
>>> So, what am I doing wrong?
>>>
>>> P.S. I know I could reverse the order of the data in the lists (i.e.
>>> probably changing to lists rather than vectors for conj-ing purposes), but
>>> im interested in vectors specifically.
>>>
>>> Thanks
>>>
>>> Andy
>>>
>>> --
>>> 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/d/optout.
>>>
>>
>>  --
>> 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/d/optout.
>>
>
>  --
> 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/d/optout.
>

-- 
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/d/optout.


Re: updating the last member

2014-03-27 Thread Andy Smith
I was hoping there would be something like the :last keyword out of the box?

-- 
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/d/optout.


vim-fireplace debug workflow: modifying jars

2014-03-27 Thread Brian Craft
Describing my debug workflow woes at clojure/west, it was suggested to me 
that I could jump into the jar file for a library and add print statements 
to elucidate its inner workings. I guess this is supported in emacs? Jump 
into the library source jar, edit, reload into the repl? How does this 
work, exactly? Does it rewrite the zip file and load that to the repl, or 
just update the repl from the working buffer?

I just tried this in vim-fireplace, but it threw an error on writing to the 
jar buffer. Alternatively, perhaps I should eval it w/o trying to save the 
jar. That works so long as I then only evaluate expressions from the same 
namespace. In other namespaces, the edits are not apparent. It's like there 
are two versions of the namespace active in the repl. Not sure what's going 
on, or how to make other namespaces aware of the changes.

-- 
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/d/optout.


Re: vim-fireplace debug workflow: modifying jars

2014-03-27 Thread Michael Blume
Don't worry about the jar, especially. You can have your own git checkout 
of the upstream project you're working with, and that'll work just fine. 
Open a source file you need to work with, connect with nrepl, edit a 
function, and eval -- that should be enough.

On Thursday, March 27, 2014 11:43:19 AM UTC-7, Brian Craft wrote:
>
> Describing my debug workflow woes at clojure/west, it was suggested to me 
> that I could jump into the jar file for a library and add print statements 
> to elucidate its inner workings. I guess this is supported in emacs? Jump 
> into the library source jar, edit, reload into the repl? How does this 
> work, exactly? Does it rewrite the zip file and load that to the repl, or 
> just update the repl from the working buffer?
>
> I just tried this in vim-fireplace, but it threw an error on writing to 
> the jar buffer. Alternatively, perhaps I should eval it w/o trying to save 
> the jar. That works so long as I then only evaluate expressions from the 
> same namespace. In other namespaces, the edits are not apparent. It's like 
> there are two versions of the namespace active in the repl. Not sure what's 
> going on, or how to make other namespaces aware of the changes.
>

-- 
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/d/optout.


Tales From Clojure/West 2014

2014-03-27 Thread John Wetherill
I attended Clojure/West this week and wanted to send kudos to the 
organizers and Clojure community in general: this was an exciting event, 
one of the best development shows I've attended in terms of quality, 
enthusiasm, very high signal to noise ratio, and technical content.

I wrote up a quick blog/braindump on the experience, and a couple of folks 
suggested I post it to this group. Here it is:


http://www.activestate.com/blog/2014/03/getting-clojure-tales-clojurewest-2014

I have more to say once I come down from this week.

John

-- 
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/d/optout.


Re: vim-fireplace debug workflow: modifying jars

2014-03-27 Thread Moritz Ulrich
Checking out a project your project depend on, finding the right
version, etc. is quite cumbersome.

With Emacs/nrepl, you can just press M-. over any function to jump to
the definition, even when it's inside a jar.
You can also edit and reload it (via C-c C-c). I don't think you can
save it, but that isn't necessary to reload the function/namespace.
Cider can re-evaluate a whole buffer or region in the buffer without
the need to save it.

On Thu, Mar 27, 2014 at 7:49 PM, Michael Blume  wrote:
> Don't worry about the jar, especially. You can have your own git checkout of
> the upstream project you're working with, and that'll work just fine. Open a
> source file you need to work with, connect with nrepl, edit a function, and
> eval -- that should be enough.
>
>
> On Thursday, March 27, 2014 11:43:19 AM UTC-7, Brian Craft wrote:
>>
>> Describing my debug workflow woes at clojure/west, it was suggested to me
>> that I could jump into the jar file for a library and add print statements
>> to elucidate its inner workings. I guess this is supported in emacs? Jump
>> into the library source jar, edit, reload into the repl? How does this work,
>> exactly? Does it rewrite the zip file and load that to the repl, or just
>> update the repl from the working buffer?
>>
>> I just tried this in vim-fireplace, but it threw an error on writing to
>> the jar buffer. Alternatively, perhaps I should eval it w/o trying to save
>> the jar. That works so long as I then only evaluate expressions from the
>> same namespace. In other namespaces, the edits are not apparent. It's like
>> there are two versions of the namespace active in the repl. Not sure what's
>> going on, or how to make other namespaces aware of the changes.
>
> --
> 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/d/optout.

-- 
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/d/optout.


Re: anyone in Santa Cruz?

2014-03-27 Thread John Wetherill
Yes - would love to participate in any Santa Cruz -based Clojure 
meetups/discussions. I work at Cruzio a few days a week.



On Thursday, March 27, 2014 10:21:32 AM UTC-7, Brian Craft wrote:
>
> Looking for clojure users in the Santa Cruz, Ca area who are interested in 
> a meetup, study group, etc.
>

-- 
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/d/optout.


Re: anyone in Santa Cruz?

2014-03-27 Thread Stanislav Sedov

On Mar 27, 2014, at 10:21 AM, Brian Craft  wrote:

> Looking for clojure users in the Santa Cruz, Ca area who are interested in a 
> meetup, study group, etc.
> 

I’m in Sunnyvale and using Clojure occasionally.  Not exactly Santa Cruz, but I 
travel there
often.

--
ST4096-RIPE





signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: anyone in Santa Cruz?

2014-03-27 Thread Tim
Yes, please!

On Thursday, March 27, 2014 10:21:32 AM UTC-7, Brian Craft wrote:
>
> Looking for clojure users in the Santa Cruz, Ca area who are interested in 
> a meetup, study group, etc.
>

-- 
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/d/optout.


Re: vim-fireplace debug workflow: modifying jars

2014-03-27 Thread Brian Craft
This seems like the right approach, but something is odd about the 
namespacing. Details:

0) using vim-fireplace
1) I jump into honeysql-0.4.2.jar::honeysql/format.clj
2) edit the format fn to always return "foo", and eval the new fn definition
3) Eval (format {:select [5]}) in the format.clj split, get "foo". Great.
4) In my app core.clj split, eval (hsql/format {:select [5]}), get "SELECT 
5"

So, in my app.core namespace, the hsql/format fn is unchanged.

Ugh I think I just found part of the problem. If I invoke 
honeysql.format/format, I get the new version. honeysql core is doing

(defalias format format/format)

where defalias is some macro that calls (intern *ns* ...). I think honeysql 
is explicitly caching the old definition of the function. :-p

And, yes, indeed, if I reload honeysql core, the format fn is updated. That 
hurts. Not sure why honeysql needs to cache function references like this.


On Thursday, March 27, 2014 11:52:36 AM UTC-7, Moritz Ulrich wrote:
>
> Checking out a project your project depend on, finding the right 
> version, etc. is quite cumbersome. 
>
> With Emacs/nrepl, you can just press M-. over any function to jump to 
> the definition, even when it's inside a jar. 
> You can also edit and reload it (via C-c C-c). I don't think you can 
> save it, but that isn't necessary to reload the function/namespace. 
> Cider can re-evaluate a whole buffer or region in the buffer without 
> the need to save it. 
>
> On Thu, Mar 27, 2014 at 7:49 PM, Michael Blume 
> > 
> wrote: 
> > Don't worry about the jar, especially. You can have your own git 
> checkout of 
> > the upstream project you're working with, and that'll work just fine. 
> Open a 
> > source file you need to work with, connect with nrepl, edit a function, 
> and 
> > eval -- that should be enough. 
> > 
> > 
> > On Thursday, March 27, 2014 11:43:19 AM UTC-7, Brian Craft wrote: 
> >> 
> >> Describing my debug workflow woes at clojure/west, it was suggested to 
> me 
> >> that I could jump into the jar file for a library and add print 
> statements 
> >> to elucidate its inner workings. I guess this is supported in emacs? 
> Jump 
> >> into the library source jar, edit, reload into the repl? How does this 
> work, 
> >> exactly? Does it rewrite the zip file and load that to the repl, or 
> just 
> >> update the repl from the working buffer? 
> >> 
> >> I just tried this in vim-fireplace, but it threw an error on writing to 
> >> the jar buffer. Alternatively, perhaps I should eval it w/o trying to 
> save 
> >> the jar. That works so long as I then only evaluate expressions from 
> the 
> >> same namespace. In other namespaces, the edits are not apparent. It's 
> like 
> >> there are two versions of the namespace active in the repl. Not sure 
> what's 
> >> going on, or how to make other namespaces aware of the changes. 
> > 
> > -- 
> > 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/d/optout. 
>

-- 
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/d/optout.


[ANN] Clojure cheat sheet (v13)

2014-03-27 Thread Andy Fingerhut
The version published at http://clojure.org/cheatsheet has been updated to
the latest version, with new functions and macros added to Clojure 1.6
marked with (1.6) before them.

There is a link near the top of that page "Download other versions with
tooltips" that links to a page with several other variations of the cheat
sheet, of which this is my personal favorite:


http://jafingerhut.github.io/cheatsheet-clj-1.3/cheatsheet-tiptip-cdocs-summary.html

It is my favorite because you can hover over Clojure symbol names and the
doc string, plus a little more info, pops up, without having to click
anything.  Nice for quickly browsing the docs of functions that have been
organized by roughly similar functionality.


Most links there go to docs for the symbol on ClojureDocs.org, but for the
relatively few added since Clojure 1.4, it links to the auto-generated docs
(from the doc strings) on clojure.github.io.  If/when ClojureDocs.org is
updated to add those few symbols, I can change those links.

I still haven't added reducers -- since I haven't really used them myself,
I don't have any bright ideas on how to organize them.  In the absence of
insightful suggestions from those who are familiar with them, I will
probably just toss them all together in one new category for reducers and
stick them somewhere.

Andy

-- 
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/d/optout.


looking for a lzw decompress routine written in clojure

2014-03-27 Thread bww00amd...@yahoo.com


Thanks 
Bryan

-- 
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/d/optout.


Re: looking for a lzw decompress routine written in clojure

2014-03-27 Thread Gary Trakhman
Why? A java one exists.


On Thu, Mar 27, 2014 at 6:09 PM, bww00amd...@yahoo.com <
bww00amd...@yahoo.com> wrote:

>
>
> Thanks
> Bryan
>
> --
> 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/d/optout.
>

-- 
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/d/optout.


Re: Concurrency, Parallelism, and State. And Zombies.

2014-03-27 Thread Daniel Higginbotham
Thanks for the positive feedback, Gary and Di :) It's very encouraging to 
me.

Daniel

-- 
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/d/optout.


Re: anyone in Santa Cruz?

2014-03-27 Thread Dave Ray
I'd be interested.
Dave


On Thu, Mar 27, 2014 at 1:04 PM, Tim  wrote:

> Yes, please!
>
>
> On Thursday, March 27, 2014 10:21:32 AM UTC-7, Brian Craft wrote:
>
>> Looking for clojure users in the Santa Cruz, Ca area who are interested
>> in a meetup, study group, etc.
>>
>  --
> 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/d/optout.
>

-- 
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/d/optout.


Re: anyone in Santa Cruz?

2014-03-27 Thread Paul Mooser
I'm also in Santa Cruz. 


-- 
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/d/optout.


Re: [ANN] Clojure 1.6

2014-03-27 Thread David Nolen
It looks like the zip file that usually included with the releases is
missing?

http://repo1.maven.org/maven2/org/clojure/clojure/1.5.1/

vs.

http://repo1.maven.org/maven2/org/clojure/clojure/1.6.0/

Thanks,
David


On Tue, Mar 25, 2014 at 7:00 AM, Alex Miller  wrote:

> We are pleased to announce the release of Clojure 1.6.
>
> Getting Clojure:
>
>   Web:  http://clojure.org/downloads
>   Lein/Maven:   :dependencies [[org.clojure/clojure "1.6.0"]]
>
> (The download should be available shortly)
>
> This release includes significant features and bug fixes, documented
> here:
>
>   https://github.com/clojure/clojure/blob/master/changes.md
>
> The number of Clojure contributors continues to grow. Thanks to all
> of those who contributed specifically to Clojure 1.6:
>
> Bruce Adams
> Vipul Amler
> Mike Anderson
> Timothy Baldridge
> Brandon Bloom
> Toby Crawley
> Andy Fingerhut
> Michael Fogus
> Gary Fredricks
> Joe Gallo
> Christophe Grand
> Chris Gray
> Anthony Grimes
> Stuart Halloway
> Herwig Hochleitner
> Gabriel Horner
> Colin Jones
> Stefan Kamphausen
> Scott Lowe
> Alan Malloy
> Michał Marczyk
> Tim McCormack
> Alex Miller
> Steve Miner
> Nicola Mometto
> Max Penet
> Christoffer Sawicki
> Karsten Schmidt
> Ghadi Shayban
> Stuart Sierra
> Brian Taylor
> Devin Walters
> Jason Wolfe
>
> and to the total list of contributors from all releases:
> http://clojure.org/contributing#patches
>
> Thanks!
>
> Alex Miller
>
>  --
> 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/d/optout.
>

-- 
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/d/optout.


Re: anyone in Santa Cruz?

2014-03-27 Thread Brian Craft
Great to see some replies! Starting an email thread to arrange details.


On Thu, Mar 27, 2014 at 5:04 PM, Paul Mooser  wrote:

> I'm also in Santa Cruz.
>
>
>  --
> 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/d/optout.
>

-- 
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/d/optout.


Re: looking for a lzw decompress routine written in clojure

2014-03-27 Thread bww00amd...@yahoo.com
yep, i actually have one but i thought it would be easier with all clojure.
i am going to go ahead and look at the clojure > java class interop with 
the lzw java class i have

i am on a learn clojure quest

Thanks again

On Thursday, March 27, 2014 5:09:52 PM UTC-5, bww00...@yahoo.com wrote:
>
>
>
> Thanks 
> Bryan
>

-- 
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/d/optout.


Re: om: state management considerations

2014-03-27 Thread Jeff Rose
There is some explanation about component local state in the documentation 
here:

https://github.com/swannodette/om/wiki/Conceptual-overview

UI components will often have transient state that really doesn't make 
sense to expose externally.  For example the characters in an input as 
someone is typing, or the highlighted? bool for some mouse-over logic, that 
kind of thing.  Also, component local state is always up to date, whereas 
the global state is updated in a more stepwise fashion with each call of 
the render loop.

-Jeff

On Thursday, March 27, 2014 4:20:41 PM UTC+8, rlewczuk wrote:
>
> Hi, 
>
> After playing a bit with om, I'm somewhat confused about state maintaining 
> possibilities it offers. There is global application state and local 
> component state.  I have some doubts about using local state as it seems to 
> lead to troubles as soon as code grows a bit (I'm thinking about 
> traditional widgets, eg. data table with editing capability - somewhat 
> boring stuff, yet quite common in many cases). Most common approach to this 
> seems to be to set up some local state and then use core.async channels for 
> communication and updating global state asynchronousluy (go ...) blocks. 
>
> My feeling is that it creates lots of places with application state which 
> negates to some extent main premise of state handling by om. Do I need to 
> use local state at all ? Are there any alternatives ? I'm thinking about 
> using keyword namespacing in global state to separate concerns, for example 
> viewed data table row could be kept as something like :d/current-row 
> somewhere in global state ('d' stands for data) but when row editing starts 
> :e/current-row appears and is used by input fields ('e' stands for 
> editing). UI configuration (column descriptions etc.) would use 'u' prefix 
> (eg. :u/columns) for example etc. 
>
> My feeling is that keeping application state strictly in global state 
> would make some things easier (testing+debugging UI components, recording 
> user sessions in full detail by listening on :tx-listen etc.). But blindly 
> following all-in-global state also can have its pitfalls that I'm not aware 
> of (as cljs/reactjs/om newbie).
>
>
> There are the following aspects of UI state as I see it:
>
> - hardcoded UI config data (widget descriptions, column descriptions etc.);
>
> - customizable UI config data (eg. skins and styles that application user 
> can choose);
>
> - UI code (function references sometimes bound somewhere to application 
> state);
>
> - UI state (eg. currently edited data, flags marking that data is being 
> edited/viewed row being selected etc.)
>
> - business data (fetched REST from backend);
>
> - inherently stateful stuff (eg. core.async channels);
>
> - etc. 
>
>
> My question is: where would you recommend placing individual bits of 
> config/data/state listed above (global state? local state? :opts ? global 
> :shared ? etc.) ?
>
> Regards,
> rle
>
>
>

-- 
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/d/optout.


Re: Writing tests for a live trading API?

2014-03-27 Thread dm3
I would strongly recommend against doing tests against a live exchange, 
because there are just too many failure modes (network down, exchange down, 
exchange hostname changed, etc.) as well as the possibility to execute 
trades and lose money.

What I usually do is this:

* create stub requests/responses produced by the system you're integrating 
with - either in separate textfiles or generated with simple-check (now 
test.check)
* use the defined requests/responses when testing the code which integrates 
with the system
* create a mock system for use in repl environment (uses same 
requests/responses as the tests)

This requires some effort to set up, but really pays of with getting rid of 
a live dependency.

If you're worried about API changes, you can still have a very minimal live 
testcase which compares exchange's responses with your stubs, although it 
shouldn't test for any logic, only structure.

On Wednesday, 26 March 2014 09:18:40 UTC+2, JPH wrote:
>
> Hi all. I'm still relatively new to Clojure and I haven't spent much 
> time on testing before. I've recently written some libraries to talk to 
> Bitcoin exchanges (clj-havelock, clj-btce, cryptick), and I'd like to 
> add tests to them. 
>
> I'd like some advice around how to test against a live service (there is 
> not test service available) where there's a financial impact if 
> something goes wrong (someone buys/sells by accident). 
>
> My manual REPL-testing usually involve creating several orders with 
> price spreads that are unlikely to execute. For instance, selling 1 
> Litecoin for 1 Bitcoin. Buying 1 Bitcoin for $5 USD. 
>
> My concern is if someone runs the tests with bad inputs, resulting in 
> real orders being executed. 
>
> I can write tests that pull in API credentials from a file in my home 
> directory, and define price ranges for orders outside the normal spread. 
> These could then be fed into the tests. However, would it be better to 
> try and mock the trading API responses rather than do it live? Or 
> perhaps require a flag to run dangerous tests? 
>
> Ultimately I want to be able to demonstrate the libraries are mature 
> with good test coverage, but I'm worried about the right approach. Any 
> advice would be appreciated. 
>
> Thanks in advance, 
> JPH 
>
>
>
>
>

-- 
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/d/optout.


Unexpected core.async timeout behaviour

2014-03-27 Thread Peter Taoussanis
Hi all, quick question:

`(dotimes [_ 5] (go ( java.lang.AssertionError: Assert 
failed: No more than 1024 pending takes are allowed on a single channel.

It appears (?) that there's a (surprisingly low?) limit to the number of 
unique timeout timestamps that can be simultaneously queued. 

Is this the expected behaviour running Clojure 1.6.0, core.async 
0.1.278.0-76b25b-alpha?

Much appreciated, thanks! Cheers :-)
 

-- 
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/d/optout.


Re: How did you learn Clojure?

2014-03-27 Thread Aditya Athalye
@Marcus, Thanks for your kind words, Marcus.

@Gareth, +1. I feel re-implementing a past solution is a really good 
learning technique.
Half the battle is to correctly understand a problem/domain and work out 
how to solve it.
No point taking on that kind of friction if the purpose is to learn a new 
language.



On Thursday, March 27, 2014 10:20:11 PM UTC+5:30, Marcus Blankenship wrote:
>
> Awesome, thanks for the advice.  I need to find something I’ve written and 
> translate it to Clojure...
> On Mar 26, 2014, at 7:14 PM, gaz jones > 
> wrote:
>
> A technique I use whenever I need to learn a new language is to write the 
> same application I already have in another language.  I generally choose 
> downloading nzbs from usenet as it can involve a number of interesting 
> programming techniques, at least enough to give you a pretty good idea of 
> how a language handles things like:
>
> * threading and work queues (downloading files concurrently)
> * socket io (writing a simple nntp client)
> * xml processing (parsing nzb files)
> * binary encoding/decoding (yenc implementation)
> * curses style ui
> * web ui
> * command line arguments
> * configuration
> * signal handling
> * testing (haha kidding)
>
> TBH I usually get about 50% of the way through and have enough of a handle 
> on the language at that point to abandon my efforts and move on.
>
> On Wed, Mar 26, 2014 at 7:22 PM, Daniel Higginbotham 
> 
> > wrote:
>
>> Chiming in a bit late, but here was my path:
>>
>> * Read "Land of Lisp" by Conrad Barski. This was my first real contact 
>> with lisp and functional programming. I found it challenging, but the book 
>> is well-written and the technique of teaching through writing games was 
>> perfect for me. It uses common lisp which is almost baroque compared to 
>> Clojure, but it was helpful later in getting a better sense of Clojure's 
>> roots. Also, most of the classic lisp books out there use common lisp
>> * Tried to write my own web-based game using common lisp. This was true 
>> fun and I learned a ton
>> * Read "On Lisp" by Paul Graham. It is an excellent book
>> * Was introduced to Clojure through a talk given by Alan Dipert at my 
>> workplace
>> * Learned Clojure by skipping around Clojure in Action, Programming 
>> Clojure, and Clojure Programming. Settled on Clojure Programming.
>> * projecteuler.net has been a good help
>> * I've been teaching Clojure to folks at work, which forces me to deeply 
>> understand the material
>> * At the same time, I've kept building little web apps to solidify my 
>> knowledge. One of them, http://gratefulplace.com, is actually used :)
>>
>> I feel like I know enough to get stuff done, but there's still so much 
>> more to learn. Most recently I've been brushing up on math/logic so that I 
>> can better understand the more mathy texts whenever I encounter them.
>>
>>
>> On Thursday, March 20, 2014 9:08:41 PM UTC-4, Marcus Blankenship wrote:
>>>
>>> Hi Folks, 
>>>
>>> I'm a post technical PM who's fascinated by Clojure, and want to learn 
>>> it, but am having a hard time without a "real" project to work on. It's 
>>> actually excited me so much I'm considering hanging up my PM hat and diving 
>>> back in the "programmer pool" again! 
>>>
>>> My problem appears to be 1) focus, and 2) fear. Focus because I can't 
>>> (yet) earn a living on a clojure project, so it must be done during "off 
>>> hours". Fear because it's harder and more different than the old OO 
>>> languages I've used in the past. 
>>>
>>> So I'm curious: how did you learn Clojure well enough to be proficient 
>>> with it, or how are you working on learning it? 
>>>
>>> Anyone else facing the focus + fear dilemma? 
>>>
>>> Sent from my iPhone
>>
>>
>> -- 
>> 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/d/optout.
>>
>
>
> -- 
> 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.
> T