Re: Noob Question - Clojure number rounding

2012-09-11 Thread Pascal Chatterjee
This doesn't seem to work for non-terminating decimals like 1/3: (defn round [s n] > (.setScale (bigdec n) s java.math.RoundingMode/HALF_EVEN)) > #'user/round > user=> (round 3 (/ 1 3)) > ArithmeticException Non-terminating decimal expansion; no exact > representable decimal result. java.mat

Re: Teaching beginners to program using an interactive ClojureScript REPL

2012-07-17 Thread Pascal Chatterjee
> I think you should not explain def as a function, as that is not a > helpful simplification but rather just misleading. > > You could just explain how it behaves without mentioning special forms > vs functions. > I see what you mean. My point is more that special forms have the same synta

Re: talking to machines: Teaching beginners to program with an interactive ClojureScript REPL

2012-07-16 Thread Pascal Chatterjee
Oops, double post, can someone delete this? On Saturday, 14 July 2012 18:03:16 UTC+2, Pascal Chatterjee wrote: > > Hey everyone, > > I've made a website <http://talkingtomachines.org> that embeds an > interactive ClojureScript REPL that I'd like to try and use to t

Re: Teaching beginners to program using an interactive ClojureScript REPL

2012-07-16 Thread Pascal Chatterjee
Thanks for your feedback, I'm glad you like it! I'm reading through the SICP right now and I'll definitely use it as inspiration for future chapters. The trickiest thing I've found so far is that, for simplicity, I've explained def as a function that takes a symbol and a value as arguments. I'

Teaching beginners to program using an interactive ClojureScript REPL

2012-07-16 Thread Pascal Chatterjee
provements to the content or architecture of the site, write to me here or send me a pull request :) I think ClojureScript opens up a lot of possibilites for teaching people to code in a powerful language right in the browser, and I'd love to see where we can take this. // Pascal. -- Pa

talking to machines: Teaching beginners to program with an interactive ClojureScript REPL

2012-07-16 Thread Pascal Chatterjee
Hey everyone, I've made a website that embeds an interactive ClojureScript REPL that I'd like to try and use to teach beginners the basics of programming. Try out the first chapter and let me know what you think! The si