summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2019-02-12 08:10:40 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-02-12 08:10:40 +0100
commitc59fa80367b25c83c0e35714a4e15862b704764e (patch)
treed37ce81341231f8cd7a6767897ecc5816281b0df /lib/pure
parent33ddc2105779938da7f8f85ec97704841f9a8fee (diff)
downloadNim-c59fa80367b25c83c0e35714a4e15862b704764e.tar.gz
deprecated list comprehension (#10636)
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/sugar.nim7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/pure/sugar.nim b/lib/pure/sugar.nim
index 53c31e8c9..c4c991214 100644
--- a/lib/pure/sugar.nim
+++ b/lib/pure/sugar.nim
@@ -123,11 +123,11 @@ macro `->`*(p, b: untyped): untyped =
   result = createProcType(p, b)
 
 type ListComprehension = object
-var lc*: ListComprehension
+var lc* {.deprecated.}: ListComprehension
 
-template `|`*(lc: ListComprehension, comp: untyped): untyped = lc
+template `|`*(lc: ListComprehension, comp: untyped): untyped {.deprecated.} = lc
 
-macro `[]`*(lc: ListComprehension, comp, typ: untyped): untyped =
+macro `[]`*(lc: ListComprehension, comp, typ: untyped): untyped {.deprecated.} =
   ## List comprehension, returns a sequence. `comp` is the actual list
   ## comprehension, for example ``x | (x <- 1..10, x mod 2 == 0)``. `typ` is
   ## the type that will be stored inside the result seq.
@@ -139,6 +139,7 @@ macro `[]`*(lc: ListComprehension, comp, typ: untyped): untyped =
   ##   const n = 20
   ##   echo lc[(x,y,z) | (x <- 1..n, y <- x..n, z <- y..n, x*x + y*y == z*z),
   ##           tuple[a,b,c: int]]
+  ## **Deprecated since version 0.19.9**
 
   expectLen(comp, 3)
   expectKind(comp, nnkInfix)