
On Wed, Aug 30, 2023 at 2:26 PM Xavier Noria <fxn@hashref.com> wrote:
Yes, when () is meant to yield a expression, you can put several statements in it. For example, consider:
(x = Module.new; p x)::C = 1
It does work as observed and intuitively it should but the documentation does not explicitly say it allows it to.
(a, b) does not play the role of an expression, right? Similarly, in your examples with puts,
puts(...)
is parsed as puts + the argument list of the call. Again, not an expression. In an argument list, a semicolon does not make sense, it is a syntax error.
My example had a space between puts and '('. The documentation says: "If you put a space between the method name and opening parenthesis, you do not need two sets of parentheses." but 'puts (:ignore; :x)' raises an error. -- konsolebox