summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorFredrik Høisæther Rasch <fredrik.rasch@gmail.com>2017-11-02 22:50:29 +0100
committerAndreas Rumpf <rumpf_a@web.de>2017-11-18 14:18:00 +0100
commit6f799e15055d25c075ffc90b3ede56822021cab4 (patch)
treedbd41f3eb3844e8048edcf82e83784867e21dec5 /lib
parent3d11ef8511159fcf8ac992d93a9b7ca62a42adb8 (diff)
downloadNim-6f799e15055d25c075ffc90b3ede56822021cab4.tar.gz
Swapping asArray parameter order
In reaction to https://github.com/nim-lang/Nim/pull/6640#issuecomment-341528413
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/collections/sequtils.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pure/collections/sequtils.nim b/lib/pure/collections/sequtils.nim
index c85927808..33594c4b3 100644
--- a/lib/pure/collections/sequtils.nim
+++ b/lib/pure/collections/sequtils.nim
@@ -706,14 +706,14 @@ template newSeqWith*(len: int, init: untyped): untyped =
 
 when not defined(nimscript):
   import macros
-  macro asArray*(values: typed, targetType: typedesc): untyped =
+  macro asArray*(targetType: typedesc, values: typed): untyped =
     ## applies a type conversion to each of the elements in the specified
     ## array literal. Each element is converted to the ``targetType`` type..
     ##
     ## Example:
     ##
     ## .. code-block::
-    ##   let x = asArray([0.1, 1.2, 2.3, 3.4], int)
+    ##   let x = asArray(int, [0.1, 1.2, 2.3, 3.4])
     ##   doAssert x is array[4, int]
     ##
     ## Short notation for:
@@ -1018,7 +1018,7 @@ when isMainModule:
     doAssert seq2D == @[@[true, true], @[true, false], @[false, false], @[false, false]]
 
   when not defined(nimscript): # asArray tests
-    let x = asArray([1.2, 2.3, 3.4, 4.5], int)
+    let x = asArray(int, [1.2, 2.3, 3.4, 4.5])
     doAssert x is array[4, int]
 
   when not defined(testing):