@@ -476,19 +476,25 @@ Keyword argument default values are evaluated only when necessary
476
476
left-to-right order. Therefore default expressions may refer to
477
477
prior keyword arguments.
478
478
479
+ The types of keyword arguments can be made explicit as follows:
480
+
481
+ function f(;x::Int64=1)
482
+ ###
483
+ end
484
+
479
485
Extra keyword arguments can be collected using ``... ``, as in varargs
480
486
functions::
481
487
482
- function f(x; y=0, args ...)
488
+ function f(x; y=0, kwargs ...)
483
489
###
484
490
end
485
491
486
- Inside ``f ``, ``args `` will be a collection of ``(key,value) `` tuples,
492
+ Inside ``f ``, ``kwargs `` will be a collection of ``(key,value) `` tuples,
487
493
where each ``key `` is a symbol. Such collections can be passed as keyword
488
- arguments using a semicolon in a call, e.g. ``f(x, z=1; args ...) ``.
494
+ arguments using a semicolon in a call, e.g. ``f(x, z=1; kwargs ...) ``.
489
495
Dictionaries can also be used for this purpose.
490
496
491
- In addition, one can also pass ``(key,value) `` tuples, or any iterable
497
+ One can also pass ``(key,value) `` tuples, or any iterable
492
498
expression (such as a ``=> `` pair) that can be assigned to such a
493
499
tuple, explicitly after a semicolon. For example, ``plot(x, y;
494
500
(:width,2)) `` and ``plot(x, y; :width => 2) `` are equivalent to
0 commit comments