The block operator returns the values of the last expression but it is a common pattern to need to return values from other expressions in a block and this current requires the use of local variables. Adding a block1 operator that returns the values of the first expression would allow these pattern to be expressed as expressions without using local variables. The combination of block and block1 allows the results of an arbitrary expression to be returned.
For example to return the values of the second expression in an effective block of expressions the following is currently required:
(block
(expression1)
(set_local $v1 (expression2))
(expression3)
(get_local $v1))
With a block1 operator this could be:
(block
(expression1)
(block1
(expression2)
(expression 3)))
When the result expression has multiple values, using local variables in this pattern becomes even more verbose making block1 more compelling.
@sunfishcode Can you see an obvious way for the llvm backend to exploit this?