From: Rico Tzschichholz Date: Tue, 25 Apr 2017 15:58:49 +0000 (+0200) Subject: manual: Update from wiki.gnome.org X-Git-Tag: 0.37.1~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97a62ecda82df82d8f362de07edcb0e3d25fc697;p=thirdparty%2Fvala.git manual: Update from wiki.gnome.org --- diff --git a/doc/manual/manual.xml b/doc/manual/manual.xml index b952a5e13..5512679e4 100644 --- a/doc/manual/manual.xml +++ b/doc/manual/manual.xml @@ -850,13 +850,20 @@ loop-embedded-statement-list: loop-embedded-statement [ loop-embedded-statement-list ] Both break and continue statement are types of jump statement, described in Statements/Jump statements. -The while statement conditionally executes an embedded statement zero or more times. When the while statement is reached, the boolean expression is executed. If the boolean value is true, the embedded statement is executed and execution returns to the while statement. If the boolean value is false, execution continues after the while statement. + +
+The While Statement +The while statement conditionally executes an embedded statement zero or more times. When the while statement is reached, the boolean expression is executed. If the boolean value is true, the embedded statement is executed and execution returns to the while statement. If the boolean value is false, execution continues after the while statement. while-statement: while ( boolean-expression ) loop-embedded-statement -The do statement conditionally executes an embedded statement one or more times. First the embedded statement is executed, and then the boolean expression is evaluated. If the boolean value is true, execution returns to the do statement. If the boolean value is false, execution continues after the do statement. +The do statement conditionally executes an embedded statement one or more times. First the embedded statement is executed, and then the boolean expression is evaluated. If the boolean value is true, execution returns to the do statement. If the boolean value is false, execution continues after the do statement. do-statement: do loop-embedded-statement while ( boolean-expression ) ; -The for statement first evaluates a sequence of initialization expressions, then repeatedly executes an embedded statement. At the start of each iteration a boolean expression is evaluated, with a true value leading the execution of the embedded statement, a false value leading to execution passing to the first statement following the do statement. After each iteration a sequence of iteration expressions are evaluated. Executing this type of statement creates a new transient scope, in which any variables declared in the initializer are created. +
+ +
+The For Statement +The for statement first evaluates a sequence of initialization expressions and then repeatedly executes an embedded statement. At the start of each iteration a boolean expression is evaluated, with a true value leading to the execution of the embedded statement, a false value leading to execution passing to the first statement following the for statement. After each iteration a sequence of iteration expressions are evaluated. Executing this type of statement creates a new transient scope, in which any variables declared in the initializer are created. for-statement: for ( [ for-initializer ] ; [ for-condition ] ; [ for-iterator ] ) loop-embedded-statement for-initializer: @@ -865,22 +872,27 @@ boolean-expression for-iterator: expression-list -The foreach statement enumerates the elements of a collection, executing an embedded statement for each element of the collection. Each element in turn is assigned to a variable with the given identifier and the embedded statement is executed. Executing this type of statement creates a new transient scope in which the variable representing the collection element exists. +
+ +
+The Foreach Statement +The foreach statement enumerates the elements of a collection, executing an embedded statement for each element of the collection. Each element in turn is assigned to a variable with the given identifier and the embedded statement is executed. Executing this type of statement creates a new transient scope in which the variable representing the collection element exists. foreach-statement: foreach ( type identifier in expression ) loop-embedded-statement -Foreach Statements are able to iterate over arrays and any class that implements the Gee.Iterable interface. This may change in future if an Iterable interface is incorporated into GLib. +Foreach Statements are able to iterate over arrays and any class that implements the Gee.Iterable interface. This may change in future if an Iterable interface is incorporated into GLib. +
-Jump statements +Jump Statements Jump statements move execution to an arbitary point, dependent on the type of statement and its location. In any of these cases any transient scopes are ended appropriately: Concepts/Scope and naming and Statements/Simple statements. -A break statement moves execution to the first statement after the nearest enclosing while, do, for, or foreach statement. +A break statement moves execution to the first statement after the nearest enclosing while, do, for, or foreach statement. break-statement: break ; -A continue statement immediately moves execution the nearest enclosing while, do, for, or foreach statement. +A continue statement immediately moves execution the nearest enclosing while, do, for, or foreach statement. continue-statement: continue ; -The return statement ends the execution of a method, and therefore completes the invocation of the method. The invocation expression has then been fully evaluated, and takes on the value of the expression in the return statement if there is one. +The return statement ends the execution of a method, and therefore completes the invocation of the method. The invocation expression has then been fully evaluated, and takes on the value of the expression in the return statement if there is one. return-statement: return [ expression ] ; The throw statement throws an exception. @@ -889,14 +901,14 @@
-Try statement -The try statement provides a mechanism for catching exceptions that occur during execution of a block. Furthermore, the try statement provides the ability to specify a block of code that is always executed when control leaves the try statement. +Try Statement +The try statement provides a mechanism for catching exceptions that occur during execution of a block. Furthermore, the try statement provides the ability to specify a block of code that is always executed when control leaves the try statement. For the syntax of the try statement, See Errors/Error catching.
-Lock statement -Locks Statements are the main part of Vala's resource control mechanism. +Lock Statement +Lock statements are the main part of Vala's resource control mechanism. FIXME: Haven't actually written anything here about resource control. lock-statement: lock ( identifier ) embedded-statement