Is every literal an expression?

If you account for language-specific exceptions (Python docstrings, C macros, etc.), you are correct. In general, every literal is an expression.

Up vote 2 down vote favorite share g+ share fb share tw.

Let's begin with some definitions: An expression is a construct that produces (returns) a value. A literal is a notation for representing a fixed value. I could assume the literal is a expression that returns exactly one value.

E.g. The literal 1 is an expression that returns the value 1. Is there anything wrong in my approach or does being a literal always imply being an expression?

Thank you for clarification. Language-agnostic expression literals link|improve this question asked Nov 21 '11 at 19:40halex18618 100% accept rate.

1 I'm not sure if there's a rigid definition of "literal". OTOH, I think you'd be hard-pressed to find anything commonly considered a literal that isn't a valid expression. – delnan Nov 21 '11 at 19:44.

That's my understanding. To think of it another way: 4-3 is one way of expressing 1 1 is another way of expressing 1 They are both expressions, because they both express a value (1). But 1 is also a literal - because it's literally 1.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions