From 66cc419fd993204a66cf57a674a2c62bbd14d9fe Mon Sep 17 00:00:00 2001 From: Brujo Benavides Date: Tue, 12 Jul 2016 14:27:13 +0200 Subject: Add clarification on LC semantics (#1) It addresses the special case of generator-less LCs. As a bonus, I fixed a typo :) --- system/doc/reference_manual/expressions.xml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'system') 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
 1> [X*2 || X <- [1,2,3]].
 [2,4,6]
-

More examples are provoded in +

When there are no generators or bit string generators, a list comprehension + returns either a list with one element (the result of evaluating Expr) + if all filters are true or an empty list otherwise.

+

Example:

+
+1> [2 || is_integer(2)].
+[2]
+2> [x || is_integer(x)].
+[]
+

More examples are provided in Programming Examples.

-- cgit v1.2.3