20,741
edits
m (→for, while, foreach, and forindex loops: not sure how to explain this better to non-programmers ? - P. ??) |
|||
Line 34: | Line 34: | ||
foreach(elem; list1) { doSomething(elem); } # NOTE: the delimiter is a SEMICOLON ; | foreach(elem; list1) { doSomething(elem); } # NOTE: the delimiter is a SEMICOLON ; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
In other words, even though foreach or forindex look like function calls, they work differently. | |||
The hash/vector index expression is an lvalue that can be assigned as well as inspected: | The hash/vector index expression is an lvalue that can be assigned as well as inspected: |