&+(_:_:)
Creates a new StatementArguments
by extending the left-hand size arguments with the right-hand side arguments.
static func &+ (lhs: StatementArguments, rhs: StatementArguments) -> StatementArguments
Positional arguments are concatenated:
let arguments: StatementArguments = [1] &+ [2, 3]
// Prints [1, 2, 3]
print(arguments)
Named arguments are inserted or updated:
let arguments: StatementArguments = ["foo": 1] &+ ["bar": 2]
// Prints ["foo": 1, "bar": 2]
print(arguments)
If a named arguments is defined in both arguments, the right-hand side wins:
let arguments: StatementArguments = ["foo": 1] &+ ["foo": 2]
// Prints ["foo": 2]
print(arguments)
You can mix named and positional arguments (see the documentation of the StatementArguments
type for more information about mixed arguments):
let arguments: StatementArguments = ["foo": 1] &+ [2, 3]
// Prints ["foo": 1, 2, 3]
print(arguments)