[#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:26303] IO.foreach (and friends) effect on $< and $.

From: Charles Oliver Nutter <headius@...>
Date: 2009-10-26 01:38:54 UTC
List: ruby-core #26303
I have a few questions about how the line-by-line IO operations are
*supposed* to affect the ARGF global $< and the line number global $.

First off, it seems a bit inconsistent whether $< should be updated
for non-ARGF line iterations:

~/projects/jruby =E2=9E=94 ruby -v -e 'p $<.lineno; IO.foreach("build.xml")
{}; p $<.lineno'
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
0
1775

~/projects/jruby =E2=9E=94 ruby1.8.7 -v -e 'p $<.lineno;
IO.foreach("build.xml") {}; p $<.lineno'
ruby 1.8.7 (2009-09-11 patchlevel 202) [i686-darwin9.8.0]
0
1775

~/projects/jruby =E2=9E=94 ruby1.9 -v -e 'p $<.lineno; IO.foreach("build.xm=
l")
{}; p $<.lineno'
ruby 1.9.2dev (2009-07-23 trunk 24248) [i386-darwin9.7.1]
0
0

It seems like 1.9 is "correct" here. JRuby acts like 1.8 regardless of
1.8 or 1.9 mode.

Second, the $. variable. It appears to be consistently updated for all
Ruby versions, but I wonder whether it's useful if it isn't
thread-local. Thread-local would be better because multiple threads
iterating lines would not all be setting the same variable.

- Charlie

In This Thread

Prev Next