aboutsummaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorBrujo Benavides <[email protected]>2016-07-12 14:27:13 +0200
committerGitHub <[email protected]>2016-07-12 14:27:13 +0200
commit66cc419fd993204a66cf57a674a2c62bbd14d9fe (patch)
tree6c019dc549c1c27334c8b001588706de56f470dc /system
parent761e4679cd3963f09e6d1623734aa2c6e28d788a (diff)
downloadotp-66cc419fd993204a66cf57a674a2c62bbd14d9fe.tar.gz
otp-66cc419fd993204a66cf57a674a2c62bbd14d9fe.tar.bz2
otp-66cc419fd993204a66cf57a674a2c62bbd14d9fe.zip
Add clarification on LC semantics (#1)
It addresses the special case of generator-less LCs. As a bonus, I fixed a typo :)
Diffstat (limited to 'system')
-rw-r--r--system/doc/reference_manual/expressions.xml11
1 files changed, 10 insertions, 1 deletions
diff --git a/system/doc/reference_manual/expressions.xml b/system/doc/reference_manual/expressions.xml
index 355fd3cfef..1a3d19aed1 100644
--- a/system/doc/reference_manual/expressions.xml
+++ b/system/doc/reference_manual/expressions.xml
@@ -1541,7 +1541,16 @@ end</pre>
<pre>
1> <input>[X*2 || X &lt;- [1,2,3]].</input>
[2,4,6]</pre>
- <p>More examples are provoded in
+ <p>When there are no generators or bit string generators, a list comprehension
+ returns either a list with one element (the result of evaluating <c>Expr</c>)
+ if all filters are true or an empty list otherwise.</p>
+ <p><em>Example:</em></p>
+ <pre>
+1> <input>[2 || is_integer(2)].</input>
+[2]
+2> <input>[x || is_integer(x)].</input>
+[]</pre>
+ <p>More examples are provided in
<seealso marker="doc/programming_examples:list_comprehensions">
Programming Examples.</seealso></p>