[#25936] [Bug:1.9] [rubygems] $LOAD_PATH includes bin directory — Nobuyoshi Nakada <nobu@...>

Hi,

10 messages 2009/10/05

[#25943] Disabling tainting — Tony Arcieri <tony@...>

Would it make sense to have a flag passed to the interpreter on startup that

16 messages 2009/10/05

[#26028] [Bug #2189] Math.atanh(1) & Math.atanh(-1) should not raise an error — Marc-Andre Lafortune <redmine@...>

Bug #2189: Math.atanh(1) & Math.atanh(-1) should not raise an error

14 messages 2009/10/10

[#26222] [Bug #2250] IO::for_fd() objects' finalization dangerously closes underlying fds — Mike Pomraning <redmine@...>

Bug #2250: IO::for_fd() objects' finalization dangerously closes underlying fds

11 messages 2009/10/22

[#26244] [Bug #2258] Kernel#require inside rb_require() inside rb_protect() inside SysV context fails — Suraj Kurapati <redmine@...>

Bug #2258: Kernel#require inside rb_require() inside rb_protect() inside SysV context fails

24 messages 2009/10/22

[#26361] [Feature #2294] [PATCH] ruby_bind_stack() to embed Ruby in coroutine — Suraj Kurapati <redmine@...>

Feature #2294: [PATCH] ruby_bind_stack() to embed Ruby in coroutine

42 messages 2009/10/27

[#26371] [Bug #2295] segmentation faults — tomer doron <redmine@...>

Bug #2295: segmentation faults

16 messages 2009/10/27

[ruby-core:25937] [Feature #2131] f(not x) => syntax error

From: "James M. Lawrence" <redmine@...>
Date: 2009-10-05 06:13:35 UTC
List: ruby-core #25937
Issue #2131 has been updated by James M. Lawrence.


09/23/2009 06:26 PM - Yukihiro Matsumoto:
>|This should have been classified as a feature request.
>|
>|Since (not x) is legal syntax, it is my opinion that f(not x) should be legal.
> 
>So, do you mean a,b,c = 1,2,3 is legal syntax, should we allow
>f(a,b,c = 1,2,3) ?

That (a,b,c = 1,2,3) and f(a,b,c = 1,2,3) contain different meanings
inside the parens does not really affect my argument.

  [0] + (a, b, c = 1, 2, 3)   # => [0, 1, 2, 3]
  
Whether that should mean [0, a, b, 1, 2, 3] or something else is a
different matter.

My point is that the parens serve to disambiguate,

  [0] + a, b, c = 1, 2, 3     # => syntax error
  [0] + (a, b, c = 1, 2, 3)   # => [0, 1, 2, 3]
  [0] + f a, b, c = 1, 2, 3   # => syntax error
  [0] + f(a, b, c = 1, 2, 3)  # => ok

  true | not false            # => syntax error
  true | (not false)          # => true
  true | f not false          # => syntax error
  true | f(not false)         # => syntax error

Why should the last case fail?  I also see no reason why

  f(class Foo;attr_accessor :x;end;Foo.new.x=5)  # => syntax error

should necessarily be illegal.  It's just f(5) with a side-effect.
The parens are fully capable of capturing the expression.

I can understand ignoring this bug report because I have not provided
a backward-compatible parse.y which handles these cases.

That it was rejected immediately implies no such parse.y can exist, or
that if it did then we wouldn't want it.  Which is it and why?

----------------------------------------
http://redmine.ruby-lang.org/issues/show/2131

----------------------------------------
http://redmine.ruby-lang.org

In This Thread