# Variable Number of Arguments

funvar(a, b, x...) = (a, b, x)

println(funvar(1, 2))
println(funvar(1, 2, 3))
println(funvar(1, 2, 3, 4, 5))

# Optional Arguments

incrementor(x, inc = 1) = x + inc
println(incrementor(1))
println(incrementor(1, 2))

# Keyword Arguments
funcalc(a, b; operator = +) = operator(a, b)

println(funcalc(1, 2))
println(funcalc(1, 2, operator = *))

# Do block syntax for function Arguments

v = map(x -> begin
  if (x < 0)
    return 0
  else
    return 1
  end
end, [-1, 0, 1])

v1 = map([-1, 0, 1]) do x
  if (x < 0)
    return 0
  else
    return 1
  end
end

