File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -32,11 +32,12 @@ macro spread*(call: untyped, args: varargs[untyped]): untyped =
3232 assert arr == [1 , 2 , 3 ]
3333
3434 # table constructors:
35- let tab = {:}.spread:
36- " a" = 1 # constructors convert = in a statement to :
37- _ (" b" : 2 , " c" : 3 ) # all arguments of _ are spread directly
35+ when false : # (nim doc renders badly)
36+ let tab = {:}.spread:
37+ " a" = 1 # constructors convert = in a statement to :
38+ _ (" b" : 2 , " c" : 3 ) # all arguments of _ are spread directly
3839
39- assert tab == {" a" : 1 , " b" : 2 , " c" : 3 }
40+ assert tab == {" a" : 1 , " b" : 2 , " c" : 3 }
4041
4142 # object or tuple constructors need a single `_: _``:
4243 type Foo = object
@@ -75,6 +76,11 @@ macro spread*(call: untyped, args: varargs[untyped]): untyped =
7576template `...` * (call: untyped , args: varargs [untyped ]): untyped =
7677 # # operator version of `spread`
7778 runnableExamples:
79+ proc foo (a, b, c: int ) =
80+ echo " a: " , a
81+ echo " b: " , b
82+ echo " c: " , c
83+
7884 ... foo:
7985 1
8086 c = 3
You can’t perform that action at this time.
0 commit comments