Re: core.async - extracting code from a go block

2014-01-01 Thread Paul Butcher
Thanks all - I appreciate the thoughts. -- paul.butcher->msgCount++ Silverstone, Brands Hatch, Donington Park... Who says I have a one track mind? http://www.paulbutcher.com/ LinkedIn: http://www.linkedin.com/in/paulbutcher Skype: paulrabutcher On 1 Jan 2014, at 05:46, Timothy Baldridge wro

Re: core.async - extracting code from a go block

2013-12-31 Thread Timothy Baldridge
A few other things that might help: 1) you can use (put! c val) from inside any function. Sometimes if you want to fire and forget a send, that might be the best option 2) you can wrap the code inside the sub fns inside another go. This isn't as slow as you might think 3) think about using core.

Re: core.async - extracting code from a go block

2013-12-31 Thread Cedric Greevey
It should work if it's inlined or a macro. It won't shrink foo's generated code size any if bar is a macro, but it will split up the source code into smaller pieces if that's all you're concerned about. On Tue, Dec 31, 2013 at 8:50 PM, Paul Butcher wrote: > I recently discovered that parking ca

Re: core.async - extracting code from a go block

2013-12-31 Thread Luc Prefontaine
I would say use macros to avoid hiding calls from the go macro scope. Luc P. > I recently discovered that parking calls only work if they're directly > contained within a go block. So this works fine: > > (defn foo [ch] > (go > ( > But this: > > (defn bar [ch] > ( > (defn foo [ch] >

core.async - extracting code from a go block

2013-12-31 Thread Paul Butcher
I recently discovered that parking calls only work if they're directly contained within a go block. So this works fine: (defn foo [ch] (go (msgCount++ Silverstone, Brands Hatch, Donington Park... Who says I have a one track mind? http://www.paulbutcher.com/ LinkedIn: http://www.linkedin.c