On Tue, Sep 8, 2009 at 10:51 AM, Stephen McInerney <span dir="ltr">&lt;<a href="mailto:spmcinerney@hotmail.com">spmcinerney@hotmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">




<div>
<br>&gt; From: <a href="mailto:wescpy@gmail.com" target="_blank">wescpy@gmail.com</a>No pattern matching. And even no switches
— actually even PHP has it. Some people recommend to use “if – else if”
constructions instead…<font color="#548dd4"><tt>[??? re</tt></font><font color="#548dd4"> module was added way back in Python 1.5, and before that there was regex] </font></div></blockquote><div><br>He&#39;s talking about a different form of pattern matching. A haskell-like pattern matching examle:<br>
<br>  should_stop: Car -&gt; Light -&gt; Boolean<br>  should_stop Ambulance _  = False <br>  should_stop _ Red = True<br>  should_stop _ _ = False  <br><br>should_stop would be a function that says whether a car should stop at a light. Ambulances never stop regardless of the light; all other cars stop at red; and otherwise, cars don&#39;t stop. <br>
<br><br></div></div>