From c19fb7b366d1ccdf209c5121112fba948ca4cbf8 Mon Sep 17 00:00:00 2001 From: dumndummer Date: Wed, 28 Jan 2015 21:44:52 +0000 Subject: [PATCH 1/2] Update sequtils.nim Renamed param name 'pred' to 'op' in mapIt template to better correspond with map proc in system module --- lib/pure/collections/sequtils.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pure/collections/sequtils.nim b/lib/pure/collections/sequtils.nim index befc9bacb5..a0e9280f54 100644 --- a/lib/pure/collections/sequtils.nim +++ b/lib/pure/collections/sequtils.nim @@ -382,7 +382,7 @@ template foldr*(sequence, operation: expr): expr = result = operation result -template mapIt*(seq1, typ, pred: expr): expr = +template mapIt*(seq1, typ, op: expr): expr = ## Convenience template around the ``map`` proc to reduce typing. ## ## The template injects the ``it`` variable which you can use directly in an @@ -400,7 +400,7 @@ template mapIt*(seq1, typ, pred: expr): expr = result.add(pred) result -template mapIt*(varSeq, pred: expr) = +template mapIt*(varSeq, op: expr) = ## Convenience template around the mutable ``map`` proc to reduce typing. ## ## The template injects the ``it`` variable which you can use directly in an From 07f42fa612db998ec88dade7ea3140ba6a15fb5b Mon Sep 17 00:00:00 2001 From: dumndummer Date: Mon, 2 Feb 2015 14:42:00 +0000 Subject: [PATCH 2/2] Changed name 'pred' to 'op' in mapIt template --- lib/pure/collections/sequtils.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pure/collections/sequtils.nim b/lib/pure/collections/sequtils.nim index a0e9280f54..b527b93687 100644 --- a/lib/pure/collections/sequtils.nim +++ b/lib/pure/collections/sequtils.nim @@ -397,7 +397,7 @@ template mapIt*(seq1, typ, op: expr): expr = ## assert strings == @["4", "8", "12", "16"] var result {.gensym.}: seq[typ] = @[] for it {.inject.} in items(seq1): - result.add(pred) + result.add(op) result template mapIt*(varSeq, op: expr) = @@ -413,7 +413,7 @@ template mapIt*(varSeq, op: expr) = ## assert nums[0] + nums[3] == 15 for i in 0 ..