M
Mark McIntyre
Thats a literal in my book.
Mark McIntyre said:Er, these are all literals (as far as I'm concerned). I suspect we have a
nomenclature disagreement.
Mark McIntyre said:Thats a literal in my book.
Keith said:Get a new book.
As Ben Pfaff points out, the standard only uses the term in the
phrases "string literal" and "compound literal". Based on the usage
of the term in other languages, I tend to think of a literal as a
single token representing a constant value, what C usually calls a
"constant" (integer constant, character constant, etc.) (though that
excludes C's compound literals).
The term is admittedly ambiguous, but I suspect you're the only person
around here who's going to think that 2+2 is a "literal". The
standard has a perfectly good term for the concept we're discussing,
"constant expression".
Er, these are all literals (as far as I'm concerned). I suspect we have a
nomenclature disagreement.
You'll have to define "literal" for the rest of us then. The
standard only uses it in the phrases "string literal" and
"compound literal".
Mark McIntyre said:So? Last time I looked, the Standard wasn't a dictionary of computing
terms.
FWIW as far as I think of it, a literal value is one typed in, literally.
I don't see how that makes 3<<2 a literal and x+3 not a literal.
In any case, you're using the term in a way that nobody else does.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.