[m-rev.] diff: Update coding standard regarding if-then-else syntax

Julien Fischer jfischer at opturion.com
Mon Nov 23 10:40:57 AEDT 2015


Hi Paul,

On Mon, 23 Nov 2015, Paul Bone wrote:

> Update coding standard regarding if-then-else syntax
>
> compiler/notes/coding_standards.html:
>    As above.
> ---
> compiler/notes/coding_standards.html | 50 ++++++++++++++++++++++++++++++++----
> 1 file changed, 45 insertions(+), 5 deletions(-)
>
> diff --git a/compiler/notes/coding_standards.html b/compiler/notes/coding_standards.html
> index b6cbd0a..30bd68a 100644
> --- a/compiler/notes/coding_standards.html
> +++ b/compiler/notes/coding_standards.html
> @@ -237,11 +237,54 @@ rather than having a separate mode declaration.
> If-then-elses should always be parenthesized,
> except that an if-then-else that occurs as the else
> part of another if-then-else doesn't need to be parenthesized.
> -The condition of an if-then-else can either be on the same
> -line as the opening parenthesis and the `->',
> +Note that the
> +<code>( if <i>C</i> then <i>T</i> else <i>E</i> )</code> syntax is preferred
> +over the
> +<code>( <i>C</i> -> <i>T</i> ; <i>E</i> )</code> syntax.
> +
> +<p>
> +The condition can either be on the same line as the '<code>if</code>'
> +keyword:
> +
> +<pre>
> +    ( if test1 then
> +        goal1
> +    ; else if test2 then
> +        goal2
> +    ; else
> +        goal
> +    )

Delete the semicolons there.

Julien.



More information about the reviews mailing list