such that
const name = "name"
is actuallyconst name = constexpr "name"
.
That's a great idea. In that case, we can get rid of const name
as a special initializer and just have const name = "name"
be syntactic sugar for let name = constexpr "name"
. This makes forms like
func nameAndAge(name: constexpr String, age: constexpr Int) -> constexpr String
simpler.
Otherwise we'd have to ask in if name
is a let
or const
. (I don't know if this is even a consideration in the compiler anymore since variable parameters like func nameAndAge(var name: String)
was removed in Swift 3)