aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2016-07-14 09:28:12 +0200
committerBjörn-Egil Dahlberg <[email protected]>2016-07-14 09:28:12 +0200
commit71f7cfea14a71550100298636d9d229fafd79344 (patch)
tree938dd683d60edf3bd2c5518b7b1e0db9cb5b6930
parentb92f2964f17ac05b1ba476a4f9a7d9fd669650f9 (diff)
parent66cc419fd993204a66cf57a674a2c62bbd14d9fe (diff)
downloadotp-71f7cfea14a71550100298636d9d229fafd79344.tar.gz
otp-71f7cfea14a71550100298636d9d229fafd79344.tar.bz2
otp-71f7cfea14a71550100298636d9d229fafd79344.zip
Merge branch 'elbrujohalcon/fix-lc-doc/PR-1125/OTP-13739' into maint
* elbrujohalcon/fix-lc-doc/PR-1125/OTP-13739: Add clarification on LC semantics (#1)
-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>