<div dir="ltr">Super awesome idea! How about coma separated expressions to perform multiple asserts?<div><br></div><div style>int func(int i, int j) in(i<5, j<10)</div><div style>{</div><div style>  return i + j;</div>
<div style>}</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 16 June 2013 07:45, TommiT <span dir="ltr"><<a href="mailto:tommitissari@hotmail.com" target="_blank">tommitissari@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">"Simple things should be simple, complex things should be possible." -Alan Kay<br>
<br>
I'd like to simplify the syntax of function pre- and post-conditions when the contract block consists of a single assert statement. A special syntax for this special case would omit all of the following:<br>
1) the block's curly braces<br>
2) the assert keyword<br>
3) the semi-colon ending the assert statement<br>
4) the body keyword (if and only if it follows right after the block)<br>
<br>
So, instead of writing this:<br>
<br>
int func(int i)<br>
in<br>
{<br>
    assert(i < 5);<br>
}<br>
out(r)<br>
{<br>
    assert(r < 9);<br>
}<br>
body<br>
{<br>
    return i * 2;<br>
}<br>
<br>
...you'd be able to write this:<br>
<br>
int func(int i)<br>
in (i < 5)<br>
out(r) (r < 9)<br>
{<br>
    return i * 2;<br>
}<br>
</blockquote></div><br></div>