summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-11 10:54:23 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-11 10:54:23 +0000
commite1ac9c6a0f6a1c24571b0f33897c24b2f77fbf58 (patch)
treed19d6becc39b891b714d667231cddea543f2984f /doc
parent2f8cdb7978138742bd560e22d88d7c84e5d9a6b5 (diff)
* doc/NEWS: sorted by entry name.
* doc/NEWS: modify String#[re,n] entry. * doc/NEWS: unify method expressions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'doc')
-rw-r--r--doc/NEWS453
1 files changed, 223 insertions, 230 deletions
diff --git a/doc/NEWS b/doc/NEWS
index 9eefb80..9e42cec 100644
--- a/doc/NEWS
+++ b/doc/NEWS
@@ -1,128 +1,165 @@
-: String#to_i
+: Array expansion
- Accepts optional base argument.
+ Fixed with the following behavior:
-: Integer#to_s
+ a = *[1]
+ p a #=> [1]
- Accepts optional base argument.
+ Now 1-element array in rhs is expanded properly.
-: TCPServer#listen, UNIXServer#listen
+ a = *[1]
+ p a #=> 1
- Added.
+: allocation framework
-: String#match
+ any instance of class can be allocated by class.allocate,
+ (except a few classes).
- Added.
+: break and next
-: Syslog module
+ Extended to take an optional expression, which is used as a value
+ for termination. [experimental]
- Imported.
+: constants lookup
-: String#chomp
+ Improved at the performance of searching by using an internal hash
+ table.
- if $/ == '\n', chops off last newlines (any of \n, \r, \r\n).
+: expression parenthesis in the first argument
-: Module::new/Class::new
+ Experimentally altered to get the following code (note the space
+ after p):
- takes block.
+ p ("xx"*2).to_i
-: allocation framework
+ Interpreted as:
- any instance of class can be allocated by class.allocate,
- (except a few classes).
+ p (("xx"*2).to_i)
-: String#[]
+ Instead of:
- starting offset can be specified as optional second parameter.
+ (p("xx"*2)).to_i
-: String/Array methods
+: to_str
- returns an instance of receivers class.
+ Added to get objects which define to_str() treated as String's.
-: String::new
+ Now almost all the built-in methods try each argument with to_str()
+ when they expect it to be a String.
- returns "".
+ foo = Object.new
+ class <<foo
+ def to_str
+ "foo"
+ end
+ end
+ p File.open(foo)
+ => -:7:in `open': wrong argument type Object (expected String) (TypeError)
+ ruby 1.6.4 (2001-04-19) [i586-linux]
+ => -:7:in `open': No such file or directory - "foo" (Errno::ENOENT)
+ ruby 1.7.0 (2001-05-02) [i586-linux]
-: Dir#path
+: syslog module
- Added.
+ Imported. UNIX syslog interface.
-: Enum#sort_by
+: forwardable module
- Added.
+ Imported. Method delegation library.
-: Signal
+: pp module
- new module, has module functions Signal::trap and Signal::list.
+ Imported. Prity Printing library.
-: Curses
+: uri module
- Updated. New methods and constants for using the mouse, character
- attributes, colors and key codes have been added.
+ Imported. URI library.
-: Range#step([step=1])
+: open
+
+ Extended so that when the third argument is permission flags it
+ calls open(2) instead of fopen(3).
+
+: Array#fetch
Added.
-: Regexp
+: Array#insert(n, other, ...)
- It is being obsoleted to regard /re/ as /re/ =~ $_ in a conditional
- context. Use ~/re/ instead.
+ Added. [ruby-talk:14289]
-: String#lstrip, rstrip, lstrip!, rstrip!
+ This is much the same as (({ary[n,0] = [other,...]})) except
+ returing self.
- Added. These strip only left or right part of a string.
+ ary = [0,1,2,3]
+ ary[2, 0] = [4, 5, 6]
+ p ary
-: Socket::pack_sockaddr_in(), Socket::unpack_sockaddr_in()
+ ary = [0,1,2,3]
+ ary.insert(2, 4, 5, 6)
+ p ary
- Added. Utility for direct Socket access.
+: Array#sort!
-: Socket::pack_sockaddr_un(), Socket::unpack_sockaddr_un()
+ Changed to always return self without checking whether the sequence
+ of the elements was modified or not.
- Added. Utility for direct Socket access.
+ Beware that this behavior is not guaranteed to continue in the
+ future. Do not rely on its return value. [ruby-dev:12506]
-: String#casecmp
+: Comparison of exception classes in a rescue clause
- Added. This is a case insensitive version of String#<=>.
+ Changed to use Module#=== for comparing $! with the exception
+ class specified in each rescue clause.
-: String#eql?
+ As the previous behavior was to use kind_of?, the effect is limited
+ to the SystemCallError case. SystemCallError.=== has been newly
+ defined to return true when the two have the same errno. With this
+ change, SystemCallError's with the same errno, such as Errno::EAGAIN
+ and Errno::EWOULDBLOCK, can both be rescued by listing just one of
+ them.
- Changed to be always case sensitive.
+: Curses
-: Module#include?
+ Updated. New methods and constants for using the mouse, character
+ attributes, colors and key codes have been added.
- Added. [ruby-dev:13941]
+: Dir#path
-: Dir::chdir
+ Added.
- Changed to warn only when invoked from multiple threads or no block
- is given. [ruby-dev:13823]
+: Dir.chdir
- Dir.chdir("/tmp")
+ Extended to take a block.
- pwd = Dir.pwd #=> "/tmp"
- puts pwd
+: Dir.glob
- Dir.chdir("foo") {
- pwd = Dir.pwd #=> "/tmp/foo"
- puts pwd
+ Made to support meta-character escaping by a backslash. Wildcards
+ and spaces may now be escaped using a backslash.
- Dir.chdir("bar") { # <-- previously warned
- pwd = Dir.pwd #=> "/tmp/foo/bar"
- puts pwd
- }
+: Dir.open
- pwd = Dir.pwd #=> "/tmp/foo"
- puts pwd
- }
+ Changed to return what the block returns when a block is given, just
+ as File.open does. (It always returned (({nil})) in 1.6 and
+ prior)
- pwd = Dir.pwd #=> "/tmp"
- puts pwd
+: Dir.chdir
-: Proc#yield
+ Changed to warn only when invoked from multiple threads or no block
+ is given. [ruby-dev:13823]
- Added. This is equivalent to Proc#call except it does not check the
- number of given arguments, which are thus passed to the proc as-is.
+ Dir.chdir('foo') {
+ Dir.chdir('bar') { # previously warned
+ puts Dir.pwd
+ }
+ }
+
+: Enumerable#all?
+: Enumerable#any?
+: Enumerable#inject
+: Enumerable#sort_by
+
+ Added.
: File#fnmatch, File::Constants::FNM_*
@@ -131,36 +168,35 @@
e.g.
# exclude files matching "*.bak".
- files.reject! { |fn| File::fnmatch?("*.bak", fn) }
+ files.reject! {|fn| File.fnmatch?("*.bak", fn) }
-: Method#==
+: File.lchmod
+: File.lchown
Added.
-: Multiple assignment behavior
-
- Fixed so that "*a = nil" results in "a == []".
+: IO#puts
-: Array expansion
+ do not treat Array specially.
- Fixed with the following behavior:
+: IO.for_fd
- a = *[1]
- p a #=> [1]
+ Added.
- Now 1-element array in rhs is expanded properly.
+: IO.read
- a = *[1]
- p a #=> 1
+ Added. [ruby-talk:9460]
-: NameError & NoMethodError
+: Interrupt
- Moved and now NoMethodError < NameError < StandardError.
+ Made a subclass of SignalException. (It was a subclass of
+ Exception in 1.6 and prior)
-: open
+: Line-range operation
- Extended so that when the third argument is permission flags it
- calls open(2) instead of fopen(3).
+ Obsoleted except the case when used in a one-liner (ruby -e "..."),
+ which means "if 101..200" in a script is no longer interpreted as
+ comparison between (({$.})) and 101 or 200.
: Marshal
@@ -168,242 +204,199 @@
Fixed with loading modules.
-: constants
+: MatchData#to_ary
- Improved at the performance of searching by using an internal hash
- table.
-
-: Syntax
-
- Experimentally altered to get the following code (note the space
- after p):
+ Added for convenience of Regexp#match. [ruby-dev:12766]
- p ("xx"*2).to_i
+ Previously we had to do:
- Interpreted as:
+ foo, bar, baz = /(\w+?)\s+(\w+?)\s+(\w+)/.match("foo bar baz").to_a[1..-1]
+ p [foo, bar, baz]
- p (("xx"*2).to_i)
+ But now can do:
- Instead of:
+ _, foo, bar, baz = /(\w+?)\s+(\w+?)\s+(\w+)/.match("foo bar baz")
+ p [foo, bar, baz]
- (p("xx"*2)).to_i
+: Math.acos(x)
+: Math.asin(x)
+: Math.atan(x)
+: Math.cosh(x)
+: Math.hypot(x,y)
+: Math.sinh(x)
+: Math.tanh(x)
-: Range#to_ary
+ Added.
- Added. You can now do something like this:
+: Method#==
- a, b, c = 1..3
+ Added.
-: break and next
+: Module#include?
- Extended to take an optional expression, which is used as a value
- for termination. [experimental]
+ Added. [ruby-dev:13941]
-: to_str
+: Module#included
- Added to get objects which define to_str() treated as String's.
+ Added. This is a hook called after Module#append_feature.
- Now almost all the built-in methods try each argument with to_str()
- when they expect it to be a String.
+: Module#method_removed
+: Module#method_undefined
- foo = Object.new
- class <<foo
- def to_str
- "foo"
- end
- end
- p File.open(foo)
- => -:7:in `open': wrong argument type Object (expected String) (TypeError)
- ruby 1.6.4 (2001-04-19) [i586-linux]
- => -:7:in `open': No such file or directory - "foo" (Errno::ENOENT)
- ruby 1.7.0 (2001-05-02) [i586-linux]
-
-: Line-range operation
+ Added.
- Obsoleted except the case when used in a one-liner (ruby -e "..."),
- which means "if 101..200" in a script is no longer interpreted as
- comparison between (({$.})) and 101 or 200.
+: Module.new, Class.new
-: Comparison of exception classes in a rescue clause
+ Extended to take block.
- Changed to use ((<Module>))#=== for comparing $! with the exception
- class specified in each rescue clause.
+: Multiple assignment behavior
- As the previous behavior was to use kind_of?, the effect is limited
- to the SystemCallError case. SystemCallError.=== has been newly
- defined to return true when the two have the same errno. With this
- change, SystemCallError's with the same errno, such as Errno::EAGAIN
- and Errno::EWOULDBLOCK, can both be rescued by listing just one of
- them.
+ Fixed so that "*a = nil" results in "a == []".
-: ((<Array>))#fetch
+: NameError & NoMethodError
- Added.
+ Moved and now NoMethodError < NameError < StandardError.
-: ((<Array>))#insert(n, other, ...)
+: NoMethodError
- Added. ((<ruby-talk:14289>))
+ Added. [ruby-dev:12763]
- This is much the same as (({ary[n,0] = [other,...]})) except
- returing self.
+: NotImplementError
- ary = [0,1,2,3]
- ary[2, 0] = [4, 5, 6]
- p ary
+ Finally obsoleted. Use NotImplementedError.
- ary = [0,1,2,3]
- ary.insert(2, 4, 5, 6)
- p ary
+: Object#singleton_method_removed
+: Object#singleton_method_undefined
-: ((<Array>))#sort!
+ Added.
- Changed to always return self without checking whether the sequence
- of the elements was modified or not.
+: Proc#==
- Beware that this behavior is not guaranteed to continue in the
- future. Do not rely on its return value. ((<ruby-dev:12506>)).
+ Added.
-: ((<Dir>)).open
+: Proc#yield
- Changed to return what the block returns when a block is given, just
- as ((<File>)).open does. (It always returned (({nil})) in 1.6 and
- prior)
+ Added. This is equivalent to Proc#call except it does not check the
+ number of given arguments, which are thus passed to the proc as-is.
-: ((<Dir>)).chdir
+: Process.times
- Extended to take a block.
+ Moved from Time.times. (Time.times still remains but emits a
+ warning)
-: ((<Dir>)).glob
+: Process.waitall
- Made to support meta-character escaping by a backslash. Wildcards
- and spaces may now be escaped using a backslash.
+ Added.
-: ((<Enumerable>))#all?
-: ((<Enumerable>))#any?
-: ((<Enumerable>))#inject
+: Process::Status
- Added.
+ Added. (({$?})) is now an instance of this class.
-: ((<File>)).lchmod
-: ((<File>)).lchown
+: Range#step([step=1])
Added.
-: ((<IO>)).for_fd
+: Range#to_ary
- Added.
+ Added. You can now do something like this:
-: ((<IO>)).read
+ a, b, c = 1..3
- Added. ((<ruby-talk:9460>))
+: Regexp
-: ((<Interrupt>))
+ It is being obsoleted to regard /re/ as /re/ =~ $_ in a conditional
+ context. Use ~/re/ instead.
- Made a subclass of ((<SignalException>)). (It was a subclass of
- Exception in 1.6 and prior)
+: Regexp#options
-: ((<MatchData>))#to_ary
+ Added.
- Added for convenience of Regexp#match. ((<ruby-dev:12766>))
+: Regexp.last_match(n)
- Previously we had to do:
+ Extended to take an optional argument.
- foo, bar, baz = /(\w+?)\s+(\w+?)\s+(\w+)/.match("foo bar baz").to_a[1..-1]
- p [foo, bar, baz]
+: Signal
- But now can do:
+ Added. This module has module functions Signal.trap and Signal.list.
- _, foo, bar, baz = /(\w+?)\s+(\w+?)\s+(\w+)/.match("foo bar baz")
- p [foo, bar, baz]
+: Socket.pack_sockaddr_in, Socket.unpack_sockaddr_in
-: ((<Math>)).acos(x)
-: ((<Math>)).asin(x)
-: ((<Math>)).atan(x)
-: ((<Math>)).cosh(x)
-: ((<Math>)).sinh(x)
-: ((<Math>)).tanh(x)
-: ((<Math>)).hypot(x,y)
+ Added. Utility for direct Socket access.
- Added.
+: Socket.pack_sockaddr_un, Socket.unpack_sockaddr_un
-: ((<Module>))#included
+ Added. Utility for direct Socket access.
- Added. This is a hook called after Module#append_feature.
+: String#[regexp, nth]
-: ((<Module>))#method_removed
-: ((<Module>))#method_undefined
+ Extended to accepts optional second argument.
- Added.
+ tries match between self and REGEXP, then returns the
+ content of the NTH regexp register.
-: ((<NoMethodError>))
+: String#casecmp
- Added. ((<ruby-dev:12763>))
+ Added. This is a case insensitive version of String#<=>.
-: NotImplementError
+: String#chomp
- Finally obsoleted. Use ((<NotImplementedError>)).
+ if $/ == '\n', chops off last newlines (any of \n, \r, \r\n).
-: ((<Object>))#singleton_method_removed
-: ((<Object>))#singleton_method_undefined
+: String#eql?
- Added.
+ Changed to be always case sensitive.
-: ((<Proc>))#==
+: String#insert(n, other)
Added.
-: ((<Process>)).times
-
- Moved from ((<Time>)).times. (Time.times still remains but emits a
- warning)
+ This is much the same as (({str[n, 0] = other})) except returing
+ self.
-: ((<Process::Status>))
+: String#lstrip, rstrip, lstrip!, rstrip!
- Added. (({$?})) is now an instance of this class.
+ Added. These strip only left or right part of a string.
-: ((<Process>)).waitall
+: String#match
Added.
-: ((<Regexp>)).last_match(n)
+: String/Array methods
- Extended to take an optional argument.
+ returns an instance of receivers class.
-: ((<Regexp>))#options
+: String.new
- Added.
+ returns "".
-: ((<String>))#insert(n, other)
+: Symbol#intern
Added.
- This is much the same as (({str[n, 0] = other})) except returing
- self.
+: Symbol.all_symbols
-: ((<Symbol>)).all_symbols
+ Added. [ruby-dev:12921]
- Added. ((<ruby-dev:12921>))
+: SystemCallError.===
-: ((<Symbol>))#intern
-
- Added.
+ Added. (See the "Comparison of exception classes in a rescue clause"
+ paragraph above) [ruby-dev:12670]
-: ((<SystemCallError>)).===
+: SystemExit#status
- Added. (See the "Comparison of exception classes in a rescue clause"
- paragraph above) ((<ruby-dev:12670>))
+ Added.
-: ((<SystemExit>))#status
+: TCPServer#listen, UNIXServer#listen
Added.
-: ((<TCPSocket>)).new
-: ((<TCPSocket>)).open
+: TCPSocket.new
+: TCPSocket.open
Extended to take an address and a port number for the local side in
optional 3rd and 4th arguments.
-: ((<Time>))
+: Time
Extended to accept a negative time_t. (Only when the platform
supports it)
@@ -411,8 +404,8 @@
p Time.at(-1)
=> Thu Jan 01 08:59:59 JST 1970
-: ((<Time>))#to_a
-: ((<Time>))#zone
+: Time#to_a
+: Time#zone
Made to return "UTC" under gmtime. It used to return a platform
dependent value, typically "GMT", in 1.6 and prior.