From d3044c23d62316ee11d8dc9d30132ec456bf8535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B8is=C3=A6ther=20Rasch?= Date: Thu, 2 Nov 2017 22:50:29 +0100 Subject: [PATCH] Swapping asArray parameter order In reaction to https://github.com/nim-lang/Nim/pull/6640#issuecomment-341528413 --- lib/pure/collections/sequtils.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pure/collections/sequtils.nim b/lib/pure/collections/sequtils.nim index c85927808b..33594c4b3c 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):