[Pitch] Compile-Time Constant Values

I have quite a bit of sympathy for this line of thinking, too. I wonder if alternative keywords could take some inspiration from the way it is described or taught:

Perhaps keywords like known, verified, proven or revealed might (or might not!) be some alternatives?

static known let title = "Bar"
static verified let title = "Bar"
static proven let title = "Bar"
static revealed let title = "Bar"

I don't want to distract much from the deeper and more important discussion about the building blocks etc. But some initial ideas about a precise keyword or naming might help frame discussion and thinking about the problems compile time constants are attempting to solve.


Unrelated question. Does this pitch finally mean I can build programs with source code like this will fail to compile if the URL cannot be initialised?

static const let websiteUrl: URL = URL(string: "https://swift.org")
4 Likes