From 78b7625417783c2c1418046986d8d6080f84160e Mon Sep 17 00:00:00 2001 From: apense Date: Thu, 14 May 2015 14:16:58 -0400 Subject: [PATCH 1/5] Corrected sortedByIt example `people` needs `var` --- lib/pure/algorithm.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pure/algorithm.nim b/lib/pure/algorithm.nim index f7ccb92348..12a5e3358e 100644 --- a/lib/pure/algorithm.nim +++ b/lib/pure/algorithm.nim @@ -211,7 +211,7 @@ template sortedByIt*(seq1, op: expr): expr = ## p3: Person = (name: "p3", age: 30) ## p4: Person = (name: "p4", age: 30) ## - ## people = @[p1,p2,p4,p3] + ## var people = @[p1,p2,p4,p3] ## ## echo people.sortedByIt(it.name) ## From e7bc828ef3f0d30f6016c6f10f867e84c4ef5c0f Mon Sep 17 00:00:00 2001 From: apense Date: Thu, 14 May 2015 18:32:26 -0400 Subject: [PATCH 2/5] Update algorithm.nim --- lib/pure/algorithm.nim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/pure/algorithm.nim b/lib/pure/algorithm.nim index 12a5e3358e..6dfdff2750 100644 --- a/lib/pure/algorithm.nim +++ b/lib/pure/algorithm.nim @@ -210,8 +210,7 @@ template sortedByIt*(seq1, op: expr): expr = ## p2: Person = (name: "p2", age: 20) ## p3: Person = (name: "p3", age: 30) ## p4: Person = (name: "p4", age: 30) - ## - ## var people = @[p1,p2,p4,p3] + ## people = @[p1,p2,p4,p3] ## ## echo people.sortedByIt(it.name) ## From ddbcbab3e7df7d90086ff0c7d0a76a851dddbb87 Mon Sep 17 00:00:00 2001 From: Markus Engelbrecht Date: Fri, 15 May 2015 18:39:56 +0200 Subject: [PATCH 3/5] use new syntax for negative slicing --- doc/tut1.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/tut1.txt b/doc/tut1.txt index 58ace1dbe0..cf27ac7884 100644 --- a/doc/tut1.txt +++ b/doc/tut1.txt @@ -1325,7 +1325,7 @@ define operators which accept Slice objects to define ranges. b = "Slices are useless." echo a[7..12] # --> 'a prog' - b[11.. -2] = "useful" + b[11.. ^2] = "useful" echo b # --> 'Slices are useful.' In the previous example slices are used to modify a part of a string, and even From 7ba5f18e9dfa8767716d8c1a0d7b16f52f0c2ca3 Mon Sep 17 00:00:00 2001 From: Markus Engelbrecht Date: Fri, 15 May 2015 18:42:29 +0200 Subject: [PATCH 4/5] fix typo for noSideEffect pragma --- doc/manual/threads.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/manual/threads.txt b/doc/manual/threads.txt index fc3040c87f..11380f7570 100644 --- a/doc/manual/threads.txt +++ b/doc/manual/threads.txt @@ -37,7 +37,7 @@ that contains GC'ed memory (``string``, ``seq``, ``ref`` or a closure) either directly or indirectly through a call to a GC unsafe proc. The `gcsafe`:idx: annotation can be used to mark a proc to be gcsafe, -otherwise this property is inferred by the compiler. Note that ``noSideEfect`` +otherwise this property is inferred by the compiler. Note that ``noSideEffect`` implies ``gcsafe``. The only way to create a thread is via ``spawn`` or ``createThead``. ``spawn`` is usually the preferable method. Either way the invoked proc must not use ``var`` parameters nor must any of its parameters From 5799f4f1031dc4f019592a5d5625ebe5e89ed114 Mon Sep 17 00:00:00 2001 From: Markus Engelbrecht Date: Sat, 16 May 2015 14:34:11 +0200 Subject: [PATCH 5/5] RawFlowVar was renamed to FlowVarBase --- doc/manual/threads.txt | 2 +- doc/spawn.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/manual/threads.txt b/doc/manual/threads.txt index 11380f7570..f2b79a34f2 100644 --- a/doc/manual/threads.txt +++ b/doc/manual/threads.txt @@ -146,7 +146,7 @@ wait on multiple flow variables at the same time: # wait until 2 out of 3 servers received the update: proc main = - var responses = newSeq[RawFlowVar](3) + var responses = newSeq[FlowVarBase](3) for i in 0..2: responses[i] = spawn tellServer(Update, "key", "value") var index = awaitAny(responses) diff --git a/doc/spawn.txt b/doc/spawn.txt index fb2f851c79..36bd02e966 100644 --- a/doc/spawn.txt +++ b/doc/spawn.txt @@ -33,7 +33,7 @@ variables at the same time: # wait until 2 out of 3 servers received the update: proc main = - var responses = newSeq[RawFlowVar](3) + var responses = newSeq[FlowVarBase](3) for i in 0..2: responses[i] = spawn tellServer(Update, "key", "value") var index = awaitAny(responses)