summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorflywind <xzsflywind@gmail.com>2021-03-11 21:04:08 +0800
committerGitHub <noreply@github.com>2021-03-11 14:04:08 +0100
commitd8b5879c7df989aa258c2884eeed6e1e03856b35 (patch)
tree29338921cce78a0340ac75c9660f165ef1ecc169
parent3cbc80045dfe84e47e28abc4d19f2bbeba82748d (diff)
downloadNim-d8b5879c7df989aa258c2884eeed6e1e03856b35.tar.gz
clarify the docs of isolation (#17335)
* improve test coverage for isolation

* a bit better

* clarify the docs of isolation
-rw-r--r--lib/std/isolation.nim8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/std/isolation.nim b/lib/std/isolation.nim
index 94abef807..8daca233b 100644
--- a/lib/std/isolation.nim
+++ b/lib/std/isolation.nim
@@ -29,15 +29,21 @@ proc `=destroy`*[T](dest: var Isolated[T]) {.inline.} =
   `=destroy`(dest.value)
 
 func isolate*[T](value: sink T): Isolated[T] {.magic: "Isolate".} =
-  ## Create an isolated subgraph from the expression `value`.
+  ## Creates an isolated subgraph from the expression `value`.
+  ## Isolation is checked at compile time.
+  ##
   ## Please read https://github.com/nim-lang/RFCs/issues/244
   ## for more details.
   Isolated[T](value: value)
 
 func unsafeIsolate*[T](value: sink T): Isolated[T] =
   ## Creates an isolated subgraph from the expression `value`.
+  ## 
+  ## .. warning:: The proc doesn't check whether `value` is isolated.
+  ## 
   Isolated[T](value: value)
 
 func extract*[T](src: var Isolated[T]): T =
   ## Returns the internal value of `src`.
+  ## The value is moved from `src`.
   result = move(src.value)
tik Agaram <vc@akkartik.com> 2019-12-07 15:26:05 -0800 committer Kartik Agaram <vc@akkartik.com> 2019-12-07 18:06:16 -0800 5797 - move `enumerate/` to `tools/` directory' href='/akkartik/mu/commit/build?h=main&id=72f278ae6bb52e17dbdeac0fce41a794e8dfd0d1'>72f278ae ^
248e789e ^

bfadbd4b ^





f898ee7a ^
6e1eeeeb ^
248e789e ^

72f278ae ^
9e5e87ca ^
248e789e ^
9e5e87ca ^
248e789e ^

9e5e87ca ^


248e789e ^
9e5e87ca ^

5170e27c ^
75f2c123 ^

248e789e ^
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104