Re: feedback on side project

2015-04-14 Thread Sebastian Bensusan
I stand corrected. I guess I believed Hal Abelson when he used Scheme/Lisp interchangeably. On Tuesday, April 14, 2015 at 2:39:32 AM UTC+2, Alexis wrote: Sebastian Bensusan sbe...@gmail.com javascript: writes: As a side notes, in Lisp it is convention to append ! to those functions

Re: feedback on side project

2015-04-14 Thread Alexis
Sebastian Bensusan sbe...@gmail.com writes: I stand corrected. I guess I believed Hal Abelson when he used Scheme/Lisp interchangeably. Well, i myself consider Scheme a Lisp - particularly when comparing it to programming languages in general, rather than to other Lisps specifically - but

Re: feedback on side project

2015-04-14 Thread myguidingstar
On Tuesday, April 14, 2015 at 2:53:16 AM UTC+7, Sebastian Bensusan wrote: As a side notes, in Lisp it is convention to append ! to those functions that have side-effects (i.e. mutate state). A good candidate would be `reset-games!`. This is also an evidence that Andrea hasn't read the

Re: feedback on side project

2015-04-14 Thread andrea crotti
Yes thanks to everyone, I actually did read that guide it but after I implemented that function. And I really like this convention, but I just need to get used before I remember to add the rigth ? and !. Anyway another question about that, so suppose my ref is initialized as (defonce live-games

Re: feedback on side project

2015-04-13 Thread Sebastian Bensusan
That's what fixtures are for: https://clojuredocs.org/clojure.test/use-fixtures (with-fixture :each (reset-games)) As a side notes, in Lisp it is convention to append ! to those functions that have side-effects (i.e. mutate state). A good candidate would be `reset-games!`. On Monday, April

Re: feedback on side project

2015-04-13 Thread Alexis
Sebastian Bensusan sbe...@gmail.com writes: As a side notes, in Lisp it is convention to append ! to those functions that have side-effects (i.e. mutate state). Well, not in /all/ Lisps. :-) It is the convention in Scheme[1], for example, but not in e.g. Emacs Lisp or Common Lisp. In the

Re: feedback on side project

2015-04-13 Thread andrea crotti
Awesome thanks, the only thing is that the reason why I did the reset-games thing is because in the tests I can reset things every time. (testing create new game (reset-games) (new-game) (is (= 1 (length-current-games If I don't do that then it's harder in the tests to have a

Re: feedback on side project

2015-04-11 Thread Sebastian Bensusan
Hi, I browsed over it, a couple of things: `defonce` is meant for code reloading: (defonce live-games (ref {}))) Don't use `for` when you can use `map`: (mapv (fn [i] {:char i :visible (not (valid-char i))})) Strings can be treated as sequences: (first (.toLowerCase (str char))) Hope this