On Friday, August 14, 2015 at 11:55:32 AM UTC-7, Moe Aboulkheir wrote: > I've only looked at these examples in isolation, but there's a few > places where "if" is used over "when", with no meaningful alternate > clause - e.g. amy-send may be clearer with (when (pos? n) (recur (dec > n))) or whatever, and similarly in activate.
Thank you! I had been aware of "when" but hadn't found a good use for it. > > Using go-loop consistently across amy-send and amy-receive may give > the reader less to worry about (and indenting them like "let"). > Parameterizing the -send/-receive functions in the same way as > activate would allow the example to be runnable as-is without taking > up too much space. I'm showing both (go (loop )) and (go-loop) as a concrete example of their equivalence. I'll add some verbiage about eliminating duplication when I go to activate. > > To me, the negative/positive thing in activate seems a little > arbitrary. It may be clearer with something like > https://gist.github.com/moea/cce33ab6898f724d9a2c (I don't know if I > got that exactly right). I'm using zero as the stopping point, but I like your code a lot better. > > In general, perhaps using names with equal numbers of characters, and > moving values to the beginning/end of the lines would make the console > output easier to follow, e.g. > > Annie -> Annie (5) > Annie <- Brian (5) I'll pad with blanks to make it more readable, and change "receives" to "gets". > > or similar. > > Take care, > Moe Thanks again for the feedback. Is it OK if I list you in the credits for people who assisted with the book? > > On Fri, Aug 14, 2015 at 4:53 AM, J David Eisenberg > <[email protected]> wrote: > > I have written the introduction to Chapter 8 (Asynchronous processes), but > > I am not sure if the example programs are reasonable. The examples will > > lead into an étude to implement the card game "war" with the computer > > playing against itself via asynchronous processes. > > > > I would appreciate it if you-all could take a look at it and make > > suggestions or comments. (I'm not confident I'm anywhere near on the right > > track, so I'm OK with feedback like "OMG WTF LOL") > > > > Link is http://catcode.com/etudes-for-clojurescript/ > > > > -- > > Note that posts from new members are moderated - please be patient with > > your first post. > > --- > > You received this message because you are subscribed to the Google Groups > > "ClojureScript" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to [email protected]. > > To post to this group, send email to [email protected]. > > Visit this group at http://groups.google.com/group/clojurescript. -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/clojurescript.
