On Fri, May 4, 2012 at 6:27 AM, Subramanya Sastry <sss.li...@gmail.com> wrote:
> I was making my case on the assumption that access to $~ is always through
> Ruby code, and that if there is no reference to it in Ruby code, it is not
> needed.
> So I can think about this more concretely, can you give me example Ruby code
> where this is the case (use of $~ outside Ruby code itself)?

Here's one case for $_:

```
def foo
  p gets # sets $_
  p split # splits $_
end

foo
```

However...the methods that read $_ appear to only be 1.8-mode methods.

There are methods that read $~ as well, but as far as I could tell
they only do so to return nil if it is nil or re-use it if it hasn't
been referenced yet. So for 1.9 mode there may be no cases where
native methods read lastline or backref.

If that's the case, it would be a huge coup for us. JRuby 1.7 could
turn off the "backref/lastline method hinting" it currently does and
speed up many methods considerably.

We need to confirm this.

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to