Ruby-dev summary 23214-23268

Hi all,

This is a summary of ruby-dev ML in these days.

[ruby-dev:23212] warning: fork terminates thread

See the following example:

% ruby-1.8.1 -e 'Thread.start{sleep 1}; fork'
-e:1: warning: fork terminates thread at -e:1

This warning is produced to notice feature change of #fork in Ruby 1.8.

TANAKA Akira requested to disable this warning because the warnings
could occured at outside of my codes, such like external libraries
using #fork in it. Matz agreed with him.

[ruby-dev:23220] Ruby module

Nobuyoshi Nakada proposed a new module `Ruby’ and to move RUBY_*
constants in it e.g. Ruby::VERSION, Ruby::RELEASE_DATE.
Matz said that he does not like this idea (Ruby module) very much.

[ruby-dev:23221] English alias

Nobuyoshi Nakada suggested to make English.rb built-in.
Matz noted that `$’ variables should be obsoleted, not utilized.

NOTE: recommended style to access `$’ variables

$!         rescue => err
$"         ?
$$         Process.pid
$~         Regexp.last_match
$&         Regexp.last_match[0]
$`         Regexp.last_match.pre_match
$'         Regexp.last_match.pre_match
$+         Regexp.last_match[-1]
$*         ARGV
$?         Process.waitpid2(pid)[1]
$@         rescue => err; err.backtrace
$/         (obsolete?)
$\         (obsolete?)
$0         ?
$1,$2...   Regexp.last_match[n]
$:         $LOAD_PATH
$;         (obsolete?)
$<         ARGF
$=         (obsolete)
$>         $stdout in Ruby 1.8, $defout in Ruby 1.6
$,         (obsolete?)
$-a,...    ?
$.         ARGF.lineno

[ruby-dev:23247] IO#readpartial

TANAKA Akira suggested a new method IO#readpartial, which is
a better sysread() implementation supporting stdio buffer and
avoiding troubles due to non-blocking I/O.

– Minero Aoki
ruby-dev summary index:
http://i.loveruby.net/en/ruby-dev-summary.html

[ruby-dev:23220] Ruby module

Nobuyoshi Nakada proposed a new module `Ruby’ and to move RUBY_*
constants in it e.g. Ruby::VERSION, Ruby::RELEASE_DATE.
Matz said that he does not like this idea (Ruby module) very much.

i like this idea. i could be a place to do things like

Ruby::EXCUTABLE # ‘/usr/local/bin/ruby-1.8.1/bin/ruby’

Ruby::gem? ‘session’ # true

Ruby::pthread? # false

etc.

i mean you could put common/distilled things from rbconfig plus info about
things which were added later - methods about installed packages or someting

[ruby-dev:23247] IO#readpartial

TANAKA Akira suggested a new method IO#readpartial, which is
a better sysread() implementation supporting stdio buffer and
avoiding troubles due to non-blocking I/O.

this would be an awesome addition to the stdlib - i need this at least once
per week…

-a

···

On Wed, 31 Mar 2004, Minero Aoki wrote:

===============================================================================

EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
PHONE :: 303.497.6469
ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
URL :: Solar-Terrestrial Physics Data | NCEI
TRY :: for l in ruby perl;do $l -e “print "\x3a\x2d\x29\x0a"”;done
===============================================================================

would’nt it make sense to have this as
IO.(output|input)_record_separator ?

(both as class variable, as the default, and as instance variable)

···

il Wed, 31 Mar 2004 21:02:12 +0900, Minero Aoki aamine@loveruby.net ha scritto::

$/ (obsolete?)
$\ (obsolete?)

In article Pine.LNX.4.44.0403310557190.17153-100000@fattire.ngdc.noaa.gov,
“Ara.T.Howard” ahoward@fattire.ngdc.noaa.gov writes:

[ruby-dev:23247] IO#readpartial

TANAKA Akira suggested a new method IO#readpartial, which is
a better sysread() implementation supporting stdio buffer and
avoiding troubles due to non-blocking I/O.

this would be an awesome addition to the stdlib - i need this at least once
per week…

readpartial is rejected because matz doesn’t like the name.

···


Tanaka Akira

[ruby-dev:23220] Ruby module

Nobuyoshi Nakada proposed a new module `Ruby’ and to move RUBY_*
constants in it e.g. Ruby::VERSION, Ruby::RELEASE_DATE.
Matz said that he does not like this idea (Ruby module) very much.

i like this idea. i could be a place to do things like

Ruby::EXCUTABLE # ‘/usr/local/bin/ruby-1.8.1/bin/ruby’

Ruby::gem? ‘session’ # true

Ruby::pthread? # false

You could also have …

Ruby::LOAD_PATH # $:
Ruby::LOADED_FEATURES # $"

which gets rid of two $ variables, including one ($") which, as the OP
points out, doesn’t have a nice built in alias.

(While we’re at it, how about REQUIRED_FILES instead of
LOADED_FEATURES?)

– George

matz, how about

IO#head

or

class IO
AVAILABLE = -1
IO#read(AVAILABLE)
end

or

IO#skim

i’m dying for this - i’m reduced to character IO at times…

-a

···

On Wed, 31 Mar 2004, Tanaka Akira wrote:

In article Pine.LNX.4.44.0403310557190.17153-100000@fattire.ngdc.noaa.gov,
“Ara.T.Howard” ahoward@fattire.ngdc.noaa.gov writes:

[ruby-dev:23247] IO#readpartial

TANAKA Akira suggested a new method IO#readpartial, which is
a better sysread() implementation supporting stdio buffer and
avoiding troubles due to non-blocking I/O.

this would be an awesome addition to the stdlib - i need this at least once
per week…

readpartial is rejected because matz doesn’t like the name.

EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
PHONE :: 303.497.6469
ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
URL :: Solar-Terrestrial Physics Data | NCEI
TRY :: for l in ruby perl;do $l -e “print "\x3a\x2d\x29\x0a"”;done
===============================================================================