From mboxrd@z Thu Jan 1 00:00:00 1970 From: suckfish@ihug.co.nz To: gcc@gcc.gnu.org Subject: Suggestion re GCC's statement expression extension Date: Fri, 04 Aug 2000 19:42:00 -0000 Message-id: <14731.32536.499499.420261@sucky.fish> References: <20000804182610.A9685@pcep-jamie.cern.ch> X-SW-Source: 2000-08/msg00136.html Hi, >From the recent discussion of statement expressions, it seems that the most significant use of these is to introduce named temporary variables within an expression. Why don't we introduce an explicit construct for this, something like: __let__ int x = foo() __in__ (x * x). which would be an expression that assigns foo() to x, and then yields the value (x*x). The name x should only be visible within the __let__...__in__... expression, but the lifetime of the variable should be determined just like the lifetime of any other (unnamed) temporary introduced in an expression. (Perhaps a more C-like syntax could be used, though.) Ralph.