Re: An Averaging function

2014-07-12 Thread Stephen Feyrer
Hi, Just to let you guys know I am paying attention and am trying to get all my ducks in order. I will definitely check out the resources you've mentioned. Thank you. On 11 July 2014 08:11, Adrian Mowat adrian.mo...@gmail.com wrote: Hi Blake Brian Marick's book on FP for OO programmers is

Re: An Averaging function

2014-07-11 Thread Adrian Mowat
Hi Blake Brian Marick's book on FP for OO programmers is an excellent book for Clojure beginners who already have a programming background. https://leanpub.com/fp-oo Cheers Adrian -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this

Re: An Averaging function

2014-07-10 Thread Stephen Feyrer
Hi Sam, Lee. Thank you both. It would appear that I am faced with the old adage, A little knowledge is a dangerous thing. Again thank you, you ' ve been a great help. If I may impose upon you a little further? Would either of you be able to recommend an introductory book either for Clojure or

Re: An Averaging function

2014-07-10 Thread Linus Ericsson
You should try Clojure Programming (Halloway, Bedra). I felt enlightened after reading the first edition, the second edition is also very good! http://pragprog.com/book/shcloj2/programming-clojure /Linus On Thursday, July 10, 2014, Stephen Feyrer stephen.fey...@gmail.com wrote: Hi Sam, Lee.

Re: An Averaging function

2014-07-10 Thread Sam Ritchie
Good luck with the learning, by the way! I found that the language had a definite click after a few weeks, and then I was in for good. Because the syntax is simple, many of the examples you'll see as you work through the book have a similar shape to them; I think this makes it easier to start

Re: An Averaging function

2014-07-10 Thread blake
I have yet to find a Clojure book I consider suitable for a novice to FP programming. The problem (it seems to me) is that the people who can write books on Clojure have long ago made the paradigm shift, and don't necessarily recall how that shift happened. This is similar to what I've found in

Re: An Averaging function

2014-07-10 Thread Raoul Duke
here are some related resources (books, videos). imbibe all of these and it might help. http://realmofracket.com/ http://landoflisp.com/ https://news.ycombinator.com/item?id=1023970 -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group,

Re: An Averaging function

2014-07-10 Thread Marcus Blankenship
Ok, I'm sure this is heresy, but I'm getting a great deal from Paul Graham's On Lisp, even though the examples are in Common Lisp. Really amazing stuff!!! Sent from my iPhone On Jul 10, 2014, at 11:26 AM, Raoul Duke rao...@gmail.com wrote: here are some related resources (books, videos).

Re: An Averaging function

2014-07-10 Thread Joseph Smith
When you're done with On Lisp check out Let Over Lambda. :) --- @solussd On Jul 10, 2014, at 5:38 PM, Marcus Blankenship mar...@creoagency.com wrote: Ok, I'm sure this is heresy, but I'm getting a great deal from Paul Graham's On Lisp, even though the examples are in Common Lisp. Really

Re: An Averaging function

2014-07-10 Thread Marcus Blankenship
Have it, and it's next on my list. ;-) Thanks! On Jul 10, 2014, at 9:33 PM, Joseph Smith j...@uwcreations.com wrote: When you're done with On Lisp check out Let Over Lambda. :) --- @solussd On Jul 10, 2014, at 5:38 PM, Marcus Blankenship mar...@creoagency.com wrote: Ok, I'm sure

An Averaging function

2014-07-09 Thread Stephen Feyrer
Hi, I tried to create the function below in a Lighttable instarepl. In lieu of any better idea for formatting, thestatements below indicate instarepl output. (defn avged ([x] ((def sumed (reduce + x)) 10 (def counted (count x)) 4 (def result (/ sumed counted)) 5/2 result ))) (avged

Re: An Averaging function

2014-07-09 Thread Sam Ritchie
About code style, don't do defs inside of a function - this binds them inside the entire namespace, so your values are escaping and persisting when you just want locals. Use let: (defn averaged [x] (let [summed (reduce + x) counted (count x)] (/ summed counted))) That function

Re: An Averaging function

2014-07-09 Thread Lee Spector
On Jul 9, 2014, at 8:48 PM, Stephen Feyrer stephen.fey...@gmail.com wrote: Hi, I tried to create the function below in a Lighttable instarepl. In lieu of any better idea for formatting, thestatements below indicate instarepl output. (defn avged ([x] ((def sumed (reduce + x)) 10

Re: An Averaging function

2014-07-09 Thread Lee Spector
On Jul 9, 2014, at 9:31 PM, Lee Spector lspec...@hampshire.edu wrote: You could patch (not recommended!) this by adding do to the beginning of that list: Or -- I now see, instead of adding the do you could just remove the outermost parentheses after the parameter list. But as Sam and I said