Re: What is the meaning of an expression?

gah4 <gah4@u.washington.edu>
Fri, 14 Jan 2022 17:58:01 -0800 (PST)

          From comp.compilers

Related articles
What is the meaning of an expression? costello@mitre.org (Roger L Costello) (2022-01-14)
Re: What is the meaning of an expression? anton@mips.complang.tuwien.ac.at (2022-01-14)
What is the meaning of an expression? christopher.f.clark@compiler-resources.com (Christopher F Clark) (2022-01-14)
Re: What is the meaning of an expression? DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2022-01-15)
Re: What is the meaning of an expression? gah4@u.washington.edu (gah4) (2022-01-14)
Re: What is the meaning of an expression? gneuner2@comcast.net (George Neuner) (2022-01-15)
Re: What is the meaning of an expression? matt.timmermans@gmail.com (matt.ti...@gmail.com) (2022-01-15)
Re: What is the meaning of an expression? 0xe2.0x9a.0x9b@gmail.com (Jan Ziak) (2022-01-16)
Re: What is the meaning of an expression? 0xe2.0x9a.0x9b@gmail.com (Jan Ziak) (2022-01-17)
Re: What is the meaning of an expression? 0xe2.0x9a.0x9b@gmail.com (Jan Ziak) (2022-01-18)
Re: What is the meaning of an expression? gah4@u.washington.edu (gah4) (2022-01-18)
[6 later articles]
| List of all articles for this month |

From: gah4 <gah4@u.washington.edu>
Newsgroups: comp.compilers
Date: Fri, 14 Jan 2022 17:58:01 -0800 (PST)
Organization: Compilers Central
References: <AdgJPKhi/NiNfECvRNaA6+4Wq/M8OQ==> 22-01-052
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="12461"; mail-complaints-to="abuse@iecc.com"
Keywords: semantics
Posted-Date: 14 Jan 2022 21:23:50 EST
In-Reply-To: 22-01-052

On Friday, January 14, 2022 at 9:40:24 AM UTC-8, Roger L Costello wrote:
> Hello Compiler Experts!


> In some book I read this statement:


> The meaning of an expression is
> the value of the expression.


I think that is wrong.


C is a little strange as languages go, but you can have an expression statement like:


      1 + 1


which says to add one and one, and then ignore the result. It has a value, but no meaning.
I suspect most compilers won't even do it, but I never looked.


More common is a function call with side effects, and ignore the value.


printf("Hi there!");


is an expression with the value ignored, but with a meaning.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.