[#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:25939] Re: [Feature #2131] f(not x) => syntax error

From: "David A. Black" <dblack@...>
Date: 2009-10-05 10:23:41 UTC
List: ruby-core #25939
Hi --

On Mon, 5 Oct 2009, James M. Lawrence wrote:

> 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.

One case that comes to mind is:

   f(class Foo; attr_accessor :x; end; Foo.new.x = 5,6)

Is 6 a second argument to f, or a second argument to Foo#x= ?


David

-- 
David A. Black, Director
Ruby Power and Light, LLC (http://www.rubypal.com)
Ruby/Rails training, consulting, mentoring, code review
Book: The Well-Grounded Rubyist (http://www.manning.com/black2)

In This Thread