[#61424] [REJECT?] xmalloc/xfree: reduce atomic ops w/ thread-locals — Eric Wong <normalperson@...>

I'm unsure about this. I _hate_ the extra branches this adds;

13 messages 2014/03/12

[ruby-core:61423] [ruby-trunk - Bug #9623] [Open] warning: "named capture conflicts a local variable" does not allow loops with named captures

From: drbrain@...7.net
Date: 2014-03-11 23:37:06 UTC
List: ruby-core #61423
Issue #9623 has been reported by Eric Hodel.

----------------------------------------
Bug #9623: warning: "named capture conflicts a local variable" does not allow loops with named captures
https://bugs.ruby-lang.org/issues/9623

* Author: Eric Hodel
* Status: Open
* Priority: Normal
* Assignee: 
* Category: core
* Target version: 
* ruby -v: ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin13.0]
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
Given the following example:

    args = []
    
    remaining = 'a,b,c'
    
    begin
      /(?<token>[^,]*),?(?<remaining>.*)/ =~ remaining
    
      args << token
    end until remaining.empty?
    
    p args
    
Gives a warning with -w: test.rb:6: warning: named capture conflicts a local variable - remaining

I'm unsure if the warning is useful here.  Reassigning in the loop through the named captures seems clearer than using the regexp globals.



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

In This Thread

Prev Next