A discussion earlier today led me to question whether or not my understanding of primtives and literals is correct.
My understanding is that a literal type is spec
I just wanted to inject a quick note here.
The C# language specification clearly defines "literal" -- a literal is a source code representation of a value. Literals are things like true
, 10
, 5.7
, 'c'
, "hello"
and null -- they are text that represents a specific value.
The C# language specification uses the word "primitive" twice; it is never defined and completely vague as to what it could possibly mean.
The C# language spec has no need to use or define the word "primitive" and therefore should not make use of this vague term. I've had a talk with Mads and we've agreed that future editions of the spec will be reworded to eliminate this usage completely.
How other type systems specifications -- the reflection library, the CLI, the VES, and so on -- define the word "primitive" is of course up to them.
Thanks for bringing up the question.