Repository: incubator-systemml Updated Branches: refs/heads/master e24406c03 -> e16fe1df5
Corrected typo in 'if statement' syntax documentation Closes #102. Project: http://git-wip-us.apache.org/repos/asf/incubator-systemml/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-systemml/commit/e16fe1df Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml/tree/e16fe1df Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml/diff/e16fe1df Branch: refs/heads/master Commit: e16fe1df586371408a9dc3de29b13c98982ff57c Parents: e24406c Author: Yifan "Ethan" Xu <[email protected]> Authored: Tue Apr 5 16:40:40 2016 -0700 Committer: Deron Eriksson <[email protected]> Committed: Tue Apr 5 16:40:40 2016 -0700 ---------------------------------------------------------------------- docs/dml-language-reference.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/e16fe1df/docs/dml-language-reference.md ---------------------------------------------------------------------- diff --git a/docs/dml-language-reference.md b/docs/dml-language-reference.md index 64fd950..092a09b 100644 --- a/docs/dml-language-reference.md +++ b/docs/dml-language-reference.md @@ -274,17 +274,22 @@ The predicate in the while statement consist of operations on scalar variables a The syntax for an if statement is as follows: - if (predicate) { + if (predicate1) { statement1 statement2 ... - } [ else { + } [ else if (predicate2){ + statement1 + statement2 + ... + } ] [ else { statement1 statement2 ... } ] -The If statement has two bodies: the if body (evaluated if the predicate evaluates to true) and the optional else body (evaluated otherwise). Both, the statements in the if body and else body must be surrounded by braces, even if the body only has a single statement. The if body and else body may contain any sequence of statements. + +The If statement has three bodies: the `if` body (evaluated if predicate1 evaluates to true), the optional `else if` body (evaluated if predicate2 evaluates to true) and the optional `else` body (evaluated otherwise). There can be multiple `else if` bodies with different predicates but at most one `else` body. The bodies may contain any sequence of statements. If only a single statement is enclosed in a body, the braces surrounding the statement can be omitted. ##### Examples
