On Sat, Mar 22, 2003 at 07:39:51PM +0900, Tanaka Akira wrote:
> In article <20030321231000.GA65019 / uk.tiscali.com>,
>   Brian Candler <B.Candler / pobox.com> writes:
> 
> > Seems to be same as:  e6 = (1; +2)
> 
> The position before `;' is void context.
> And `1' is a literal which has clearly no side effect.
> 
> Why Ruby doesn't warn it as toplevel?

It does for me (under 1.6.8):

$ cat x.rb
#!/usr/local/bin/ruby -w
e6 = (1
+2)
puts e6
$ ruby x.rb
x.rb:2: warning: useless use of a literal in void context
2

and the same for (1; +2)