Re: Clojure and the Anti-If Campaign

2012-05-29 Thread Tassilo Horn
Benny Tsai writes: > There's "while" in clojure.core; would that work? That would be cheating: --8<---cut here---start->8--- user> (macroexpand '(while (foo) (bar))) (loop* [] (clojure.core/when (foo) (bar) (recur))) --8<---cut here---

Re: Clojure and the Anti-If Campaign

2012-05-29 Thread Benny Tsai
There's "while" in clojure.core; would that work? On Tuesday, May 29, 2012 8:13:24 AM UTC-7, Andrew wrote: > > Thanks for sharing your blog post. Is there an Anti-If alternative to > loop/recur in a situation where you have to poll for a condition to be > true? (Seems to me that this necessitate

Re: Clojure and the Anti-If Campaign

2012-05-29 Thread Andrew
Thanks for sharing your blog post. Is there an Anti-If alternative to loop/recur in a situation where you have to poll for a condition to be true? (Seems to me that this necessitates some kind of conditional statement) On Thursday, May 24, 2012 5:57:47 AM UTC-4, Dominikus wrote: > > Three weeks

Re: Clojure and the Anti-If Campaign

2012-05-26 Thread Mimmo Cosenza
Hi Dominikus, and thanks for sharing your valuable thought. I did not read the antiifcampaign, but I remember very well the number of ifs code lines were present in java window toolkit (1995), just because they did not add NullLayout class to polymorphically manage the absence of a layout ma

Re: Clojure and the Anti-If Campaign

2012-05-24 Thread Raoul Duke
On Thu, May 24, 2012 at 2:41 PM, Mimmo Cosenza wrote: > forgot Copernicus vs Ptolemy. But its not without mental efforts to find the > right earth/sun to swap. I'll read your post in few minutes yeah, they were all still wrong about mercury, no? :-) -- You received this message because you

Re: Clojure and the Anti-If Campaign

2012-05-24 Thread Mimmo Cosenza
Whatever model I choose to understand a piece (big or small at your preferences) of the world, when I need more than few conceptual if, there is something wrong in my understanding of that piece. I never forgot Copernicus vs Ptolemy. But its not without mental efforts to find the right earth/su

Re: Clojure and the Anti-If Campaign

2012-05-24 Thread Raoul Duke
hi! On Thu, May 24, 2012 at 4:42 AM, Rostislav Svoboda wrote: > After seeing [1] from Rich Hickey I wondered what he means with > "replace if statements with polymorphic functions"? Why and how > exactly should I do it? Your blogpost opened my eyes. Thanks a lot > Dominikus interesting thread. a

Re: Clojure and the Anti-If Campaign

2012-05-24 Thread Ambrose Bonnaire-Sergeant
I really enjoyed that, thanks Dominikus :) Ambrose On Thu, May 24, 2012 at 5:57 PM, Dominikus wrote: > Three weeks ago I stumbled across the Anti-If Campaign ( > http://www.antiifcampaign.com/). > > An instant later I realized that one could easily re-implement "if" in > Clojure with maps. More

Re: Clojure and the Anti-If Campaign

2012-05-24 Thread Rostislav Svoboda
After seeing [1] from Rich Hickey I wondered what he means with "replace if statements with polymorphic functions"? Why and how exactly should I do it? Your blogpost opened my eyes. Thanks a lot Dominikus Bost [1] http://www.infoq.com/presentations/Simple-Made-Easy -- You received this message

Clojure and the Anti-If Campaign

2012-05-24 Thread Dominikus
Three weeks ago I stumbled across the Anti-If Campaign ( http://www.antiifcampaign.com/). An instant later I realized that one could easily re-implement "if" in Clojure with maps. More interestingly, polymorphic functions can be easily motivated with the help of maps. And this naturally leads to