Conditional structures: Difference between revisions
Content added Content deleted
m (Breaking up alternatives in AutoHotkey to headers sections.) |
(→Nemerle: if-else: corrected inaccurate text; formatting) |
||
Line 2,086:
=={{header|Nemerle}}==
===if-else===
<lang Nemerle>if (the_answer == 42) FindQuestion() else Foo();
when (stock.price < buy_order) stock.Buy();
unless (text < "") Write(text);</lang>
===match===
Much cleaner than stacked if-else's, similar in some ways to switch-case (but more flexible). See [http://nemerle.org/wiki/index.php?title=Quick_Guide#Pattern_Matching here], [http://nemerle.org/wiki/index.php?title=Grok_Variants_and_matching#Matching here], or, for extra detail, [http://nemerle.org/wiki/index.php?title=Patterns_%28ref%29 the reference].
|