Martin Vidner wrote:
The return statement immediately leaves the current function or a current top level block (that contains it) and optionally assigns a return_value to this block. If blocks are nested, i.e. if the current block is contained in another block, the return statement leaves all nested blocks and defines the value of the outermost block.
Well the next paragraph in fact does mention it:
"However, if a block is used in an expression other than a block, and that expression is contained in an outer block, the return statement of the inner block won't leave the outer block but define the value of the inner block. This behavior is a as one would expect. For example in the iteration builtins in Section 8.16, “Applying Expressions To Lists And Maps”,"
Benji perhaps you can suggest better wording to make the point easier to understand.
I guess, we could write more examples into the current documentation and/or write a chapter about "Standard building blocks" or something similar... Maybe we could "learn" how to document it from another documentation of another language...? -- Lukas Ocilka, YaST Developer (xn--luk-gla45d) ----------------------------------------------------------------- SUSE LINUX, s. r. o., Lihovarska 1060/12, Praha 9, Czech Republic