Re: core.async and Joy of Clojure

2014-05-07 Thread gamma235

>
> Hey Timothy, I just finished working through the code from your talk and 
> have a question. In the code there is this code:


(go (loop []
>   (when-let [v ( (println v)
> (recur 

 


I wanted to expand it into something like a logger that writes out to a 
file though, so I made the relevant test.txt file, stuck it in resources 
and  changed the code to look like this: 

(use 'clojure.java.io)
> (use 'clojure.core.async)
>
 

> (def print-chan (chan))
>
 

> (go (loop []
>   (when-let [v ( (with-open [wrtr (writer "resources/test.txt" :append true)]

  (.write wrtr v))
> (recur 
>
> (>!! print-chan 42)


But when I do this, I find that it will only replace what is in the file, 
and not append to it. Sometimes also, the output that ends up in the file 
is a little odd, too. I tried to put 42 and I got * instead. When I use the 
writer without the  core.async functions, it works as expected. I am using 
light table. 

Jesse

-- 
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 and Joy of Clojure

2014-05-02 Thread gamma235


Wow! I had no idea about the daily specials mailing list. I have joined now 
though, so if I see a JOC special pop up I'll snatch it up. 

I don't have an e-reading platform that I like, so I have only been reading 
> bits and pieces of either edition. 


I find using my laptop with ibooks and a repl to be really helpful in, 
because I can copy and paste to test the code, and when I have questions I 
can meander and see what makes things break. 



On Friday, May 2, 2014 11:49:50 PM UTC+9, Mars0i wrote:
>
> Nice to know about the 7 models book.  I wasn't aware of it.  I can't give 
> you an opinion about JoC 2nd vs. 1st ed., though.  I haven't read either 
> thoroughly.  I only got the first edition when I bought the pre-release 2nd 
> edition package last fall.  I don't have an e-reading platform that I like, 
> so I have only been reading bits and pieces of either edition.  I'll read 
> it seriously when the paper edition comes (unless I buy a tablet first).
>
> (Are you on the Manning Publishing daily specials mailing list?  That's 
> how I got the pre-release package for 1/2 price, and I have seen that offer 
> more than once since I bought the package.  It may that at this point they 
> won't offer any further 1/2 price deals on JoC, but if they do, you could 
> buy it that way.)
>
> On Friday, May 2, 2014 1:07:36 AM UTC-5, gamma235 wrote:
>>
>> Thank you Mars0i!!
>>
>> I have a first edition copy of JOC and really like the way it just lays 
>> things out for you. I am hesitating to buy the 2nd edition, though, due to 
>> the hefty price-tag, though I am curious about logic programming and data. 
>> Would you say it is worth the money?
>>
>> I am now reading the 7 concurrency models in 7 weeks beta version 
>> (recommended by Alex Ott, above) and am finding it thoroughly enjoyable. It 
>> masquerades as language agnostic, but the first half is virtually a Clojure 
>> book in the way it introduces Java's concurrency solutions (or lack 
>> thereof), priming you for the subsequent chapters that go into Clojure's 
>> primitives, core.async, and even Clojurescript. There is a chapter on 
>> actors, using Elixir, and then the latter half gets more  general talking 
>> about how concurrency relates to big data and Hadoop, using Java. In 
>> general, I think all of the information is pertinent for a Clojure 
>> programmer who wants to become more well-rounded on the subject.
>>
>> J
>>
>> On Friday, May 2, 2014 1:07:00 PM UTC+9, Mars0i wrote:
>>>
>>> On Monday, April 28, 2014 9:42:06 AM UTC-5, gamma235 wrote:

 I heard that Joy of Clojure would be adding a lot in the 2nd edition, 
 including a section on core.logic; is core.async also on that list? 

>>>
>>> I bought the pre-release + final release *Joy of Clojure* 2nd ed. 
>>> package, so I have the v10 prerelease version.  This seems to be the final 
>>> version before the regular release.  I did a search through the v10 pdf, 
>>> and found no instances of "core.async", and the string "async" appeared 
>>> only in the word "asynchronous".  By contrast, there are indeed many 
>>> instances of "core.logic".
>>>
>>> The eBook version is supposed to come out in mid-May, and the print and 
>>> other electronic versions some time after that.  The last email that I got 
>>> says that the book "is now in production where it will get a thorough 
>>> polishing before publication."  So it sounds as if the authors and 
>>> publisher are only fixing typos and doing other small changes at this 
>>> point, and that core.async will not be discussed in the book.
>>>
>>

-- 
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 and Joy of Clojure

2014-05-02 Thread Mars0i
Nice to know about the 7 models book.  I wasn't aware of it.  I can't give 
you an opinion about JoC 2nd vs. 1st ed., though.  I haven't read either 
thoroughly.  I only got the first edition when I bought the pre-release 2nd 
edition package last fall.  I don't have an e-reading platform that I like, 
so I have only been reading bits and pieces of either edition.  I'll read 
it seriously when the paper edition comes (unless I buy a tablet first).

(Are you on the Manning Publishing daily specials mailing list?  That's how 
I got the pre-release package for 1/2 price, and I have seen that offer 
more than once since I bought the package.  It may that at this point they 
won't offer any further 1/2 price deals on JoC, but if they do, you could 
buy it that way.)

On Friday, May 2, 2014 1:07:36 AM UTC-5, gamma235 wrote:
>
> Thank you Mars0i!!
>
> I have a first edition copy of JOC and really like the way it just lays 
> things out for you. I am hesitating to buy the 2nd edition, though, due to 
> the hefty price-tag, though I am curious about logic programming and data. 
> Would you say it is worth the money?
>
> I am now reading the 7 concurrency models in 7 weeks beta version 
> (recommended by Alex Ott, above) and am finding it thoroughly enjoyable. It 
> masquerades as language agnostic, but the first half is virtually a Clojure 
> book in the way it introduces Java's concurrency solutions (or lack 
> thereof), priming you for the subsequent chapters that go into Clojure's 
> primitives, core.async, and even Clojurescript. There is a chapter on 
> actors, using Elixir, and then the latter half gets more  general talking 
> about how concurrency relates to big data and Hadoop, using Java. In 
> general, I think all of the information is pertinent for a Clojure 
> programmer who wants to become more well-rounded on the subject.
>
> J
>
> On Friday, May 2, 2014 1:07:00 PM UTC+9, Mars0i wrote:
>>
>> On Monday, April 28, 2014 9:42:06 AM UTC-5, gamma235 wrote:
>>>
>>> I heard that Joy of Clojure would be adding a lot in the 2nd edition, 
>>> including a section on core.logic; is core.async also on that list? 
>>>
>>
>> I bought the pre-release + final release *Joy of Clojure* 2nd ed. 
>> package, so I have the v10 prerelease version.  This seems to be the final 
>> version before the regular release.  I did a search through the v10 pdf, 
>> and found no instances of "core.async", and the string "async" appeared 
>> only in the word "asynchronous".  By contrast, there are indeed many 
>> instances of "core.logic".
>>
>> The eBook version is supposed to come out in mid-May, and the print and 
>> other electronic versions some time after that.  The last email that I got 
>> says that the book "is now in production where it will get a thorough 
>> polishing before publication."  So it sounds as if the authors and 
>> publisher are only fixing typos and doing other small changes at this 
>> point, and that core.async will not be discussed in the book.
>>
>

-- 
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 and Joy of Clojure

2014-05-01 Thread gamma235
Thank you Mars0i!!

I have a first edition copy of JOC and really like the way it just lays 
things out for you. I am hesitating to buy the 2nd edition, though, due to 
the hefty price-tag, though I am curious about logic programming and data. 
Would you say it is worth the money?

I am now reading the 7 concurrency models in 7 weeks beta version 
(recommended by Alex Ott, above) and am finding it thoroughly enjoyable. It 
masquerades as language agnostic, but the first half is virtually a Clojure 
book in the way it introduces Java's concurrency solutions (or lack 
thereof), priming you for the subsequent chapters that go into Clojure's 
primitives, core.async, and even Clojurescript. There is a chapter on 
actors, using Elixir, and then the latter half gets more  general talking 
about how concurrency relates to big data and Hadoop, using Java. In 
general, I think all of the information is pertinent for a Clojure 
programmer who wants to become more well-rounded on the subject.

J

On Friday, May 2, 2014 1:07:00 PM UTC+9, Mars0i wrote:
>
> On Monday, April 28, 2014 9:42:06 AM UTC-5, gamma235 wrote:
>>
>> I heard that Joy of Clojure would be adding a lot in the 2nd edition, 
>> including a section on core.logic; is core.async also on that list? 
>>
>
> I bought the pre-release + final release *Joy of Clojure* 2nd ed. 
> package, so I have the v10 prerelease version.  This seems to be the final 
> version before the regular release.  I did a search through the v10 pdf, 
> and found no instances of "core.async", and the string "async" appeared 
> only in the word "asynchronous".  By contrast, there are indeed many 
> instances of "core.logic".
>
> The eBook version is supposed to come out in mid-May, and the print and 
> other electronic versions some time after that.  The last email that I got 
> says that the book "is now in production where it will get a thorough 
> polishing before publication."  So it sounds as if the authors and 
> publisher are only fixing typos and doing other small changes at this 
> point, and that core.async will not be discussed in the book.
>

-- 
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 and Joy of Clojure

2014-05-01 Thread Mars0i
On Monday, April 28, 2014 9:42:06 AM UTC-5, gamma235 wrote:
>
> I heard that Joy of Clojure would be adding a lot in the 2nd edition, 
> including a section on core.logic; is core.async also on that list? 
>

I bought the pre-release + final release *Joy of Clojure* 2nd ed. package, 
so I have the v10 prerelease version.  This seems to be the final version 
before the regular release.  I did a search through the v10 pdf, and found 
no instances of "core.async", and the string "async" appeared only in the 
word "asynchronous".  By contrast, there are indeed many instances of 
"core.logic".

The eBook version is supposed to come out in mid-May, and the print and 
other electronic versions some time after that.  The last email that I got 
says that the book "is now in production where it will get a thorough 
polishing before publication."  So it sounds as if the authors and 
publisher are only fixing typos and doing other small changes at this 
point, and that core.async will not be discussed in the book.

-- 
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 and Joy of Clojure

2014-04-29 Thread gamma235

Thanks for the recommendation. This book looks awesome. Why haven't I heard 
of it?! 

Jesse


On Tuesday, April 29, 2014 12:16:20 AM UTC+9, Alex Ott wrote:
>
> The "Seven Concurrency Models in Seven Weeks: When Threads Unravel" (
> http://pragprog.com/book/pb7con/seven-concurrency-models-in-seven-weeks) 
> has the description of the core.async in the CSP chapter...
>
>
> On Mon, Apr 28, 2014 at 4:42 PM, gamma235 
> > wrote:
>
>>
>> Hey guys,
>>
>> I have studied the sample code snippets on the github page, read through 
>> several tutorials and watched many talks on core.async, but am still unable 
>> to effectively implement this library in my programs. I am trying to level 
>> up here with this subject, but feel like the existing documentation is kind 
>> of lacking in the middle. Are there any good resources out there that can 
>> bridge the gap between code snippets and show how the concepts of this 
>> library pertain to system design? I heard that Joy of Clojure would be 
>> adding a lot in the 2nd edition, including a section on core.logic; is 
>> core.async also on that list? 
>>
>> J
>>
>> -- 
>> 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.
>>
>
>
>
> -- 
> With best wishes,Alex Ott
> http://alexott.net/
> Twitter: alexott_en (English), alexott (Russian)
> Skype: alex.ott 
>

-- 
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 and Joy of Clojure

2014-04-29 Thread gamma235
Thank you Timothy, 

I did watch that talk! In fact, it was one of the videos that really piqued 
my enthusiasm in core.async. I had no idea that the code was available on 
github. Good news. I am thinking now about how I could use core.async to do 
useful/fun things: web-service or browser game, simulation, etc. It will be 
exciting to see how things develop in the next couple of years. Do you 
think you might put out a book about some of the stuff you've been working 
on? 

Jesse

On Tuesday, April 29, 2014 12:23:14 AM UTC+9, tbc++ wrote:
>
> I'm not sure if you have watched it yet, but my Clojure/Conj talk includes 
> quite a few examples: https://www.youtube.com/watch?v=enwIIGzhahw
>
> The code from all the examples is available here: 
> https://github.com/halgari/clojure-conj-2013-core.async-examples
>
> Timothy
>
>
> On Mon, Apr 28, 2014 at 8:42 AM, gamma235 
> > wrote:
>
>>
>> Hey guys,
>>
>> I have studied the sample code snippets on the github page, read through 
>> several tutorials and watched many talks on core.async, but am still unable 
>> to effectively implement this library in my programs. I am trying to level 
>> up here with this subject, but feel like the existing documentation is kind 
>> of lacking in the middle. Are there any good resources out there that can 
>> bridge the gap between code snippets and show how the concepts of this 
>> library pertain to system design? I heard that Joy of Clojure would be 
>> adding a lot in the 2nd edition, including a section on core.logic; is 
>> core.async also on that list? 
>>
>> J
>>
>> -- 
>> 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.
>>
>
>
>
> -- 
> “One of the main causes of the fall of the Roman Empire was that–lacking 
> zero–they had no way to indicate successful termination of their C 
> programs.”
> (Robert Firth) 
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: core.async and Joy of Clojure

2014-04-28 Thread Timothy Baldridge
I'm not sure if you have watched it yet, but my Clojure/Conj talk includes
quite a few examples: https://www.youtube.com/watch?v=enwIIGzhahw

The code from all the examples is available here:
https://github.com/halgari/clojure-conj-2013-core.async-examples

Timothy


On Mon, Apr 28, 2014 at 8:42 AM, gamma235  wrote:

>
> Hey guys,
>
> I have studied the sample code snippets on the github page, read through
> several tutorials and watched many talks on core.async, but am still unable
> to effectively implement this library in my programs. I am trying to level
> up here with this subject, but feel like the existing documentation is kind
> of lacking in the middle. Are there any good resources out there that can
> bridge the gap between code snippets and show how the concepts of this
> library pertain to system design? I heard that Joy of Clojure would be
> adding a lot in the 2nd edition, including a section on core.logic; is
> core.async also on that list?
>
> J
>
> --
> 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.
>



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

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: core.async and Joy of Clojure

2014-04-28 Thread Alex Ott
The "Seven Concurrency Models in Seven Weeks: When Threads Unravel" (
http://pragprog.com/book/pb7con/seven-concurrency-models-in-seven-weeks)
has the description of the core.async in the CSP chapter...


On Mon, Apr 28, 2014 at 4:42 PM, gamma235  wrote:

>
> Hey guys,
>
> I have studied the sample code snippets on the github page, read through
> several tutorials and watched many talks on core.async, but am still unable
> to effectively implement this library in my programs. I am trying to level
> up here with this subject, but feel like the existing documentation is kind
> of lacking in the middle. Are there any good resources out there that can
> bridge the gap between code snippets and show how the concepts of this
> library pertain to system design? I heard that Joy of Clojure would be
> adding a lot in the 2nd edition, including a section on core.logic; is
> core.async also on that list?
>
> J
>
> --
> 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.
>



-- 
With best wishes,Alex Ott
http://alexott.net/
Twitter: alexott_en (English), alexott (Russian)
Skype: alex.ott

-- 
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 and Joy of Clojure

2014-04-28 Thread gamma235

Hey guys,

I have studied the sample code snippets on the github page, read through 
several tutorials and watched many talks on core.async, but am still unable 
to effectively implement this library in my programs. I am trying to level 
up here with this subject, but feel like the existing documentation is kind 
of lacking in the middle. Are there any good resources out there that can 
bridge the gap between code snippets and show how the concepts of this 
library pertain to system design? I heard that Joy of Clojure would be 
adding a lot in the 2nd edition, including a section on core.logic; is 
core.async also on that list? 

J

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