summary refs log tree commit diff stats
path: root/lib/std
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/private/since.nim16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/std/private/since.nim b/lib/std/private/since.nim
index e4aecb61a..5b22b6391 100644
--- a/lib/std/private/since.nim
+++ b/lib/std/private/since.nim
@@ -1,3 +1,17 @@
+##[
+`since` is used to emulate older versions of nim stdlib with `--useVersion`,
+see `tuse_version.nim`.
+
+If a symbol `foo` is added in version `(1,3,5)`, use `{.since: (1.3.5).}`, not
+`{.since: (1.4).}`, so that it works in devel in between releases.
+
+The emulation cannot be 100% faithful and to avoid adding too much complexity,
+`since` is not needed in those cases:
+* if a new module is added
+* if an overload is added
+* if an extra parameter to an existing routine is added
+]##
+
 template since*(version: (int, int), body: untyped) {.dirty.} =
   ## Evaluates `body` if the ``(NimMajor, NimMinor)`` is greater than
   ## or equal to `version`. Usage:
@@ -16,4 +30,4 @@ template since*(version: (int, int, int), body: untyped) {.dirty.} =
   ##   proc fun*() {.since: (1, 3, 1).}
   ##   since (1, 3, 1): fun()
   when (NimMajor, NimMinor, NimPatch) >= version:
-    body
\ No newline at end of file
+    body
span class='oid'>42bac5242 ^
b45483f86 ^
d93749b17 ^
517312467 ^




e5aefbd1d ^
911551aae ^
3ffde39cf ^

434bdbe3e ^
3ffde39cf ^
1c6c87f47 ^
363b1c0a4 ^
8f6a275f4 ^

c9a8ada72 ^

fbe7bf3c8 ^
243e66596 ^


5492190bc ^
c60916a2a ^
cf323104f ^
c60916a2a ^
a01fd5e93 ^
cc507668c ^
aa0a9dd78 ^
a01fd5e93 ^
aa0a9dd78 ^
c60916a2a ^
cc507668c ^
308710c1e ^



2e5c75973 ^
308710c1e ^







cf323104f ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71