From e1ac9c6a0f6a1c24571b0f33897c24b2f77fbf58 Mon Sep 17 00:00:00 2001 From: aamine Date: Fri, 11 Jan 2002 10:54:23 +0000 Subject: * 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 --- doc/NEWS | 453 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 223 insertions(+), 230 deletions(-) (limited to 'doc') diff --git a/doc/NEWS b/doc/NEWS index 9eefb80f1a..9e42cec5c6 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 < -: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 < -: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 (())#=== 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 == []". -: (())#fetch +: NameError & NoMethodError - Added. + Moved and now NoMethodError < NameError < StandardError. -: (())#insert(n, other, ...) +: NoMethodError - Added. (()) + 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 -: (())#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. (()). + Added. -: (()).open +: Proc#yield - Changed to return what the block returns when a block is given, just - as (()).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. -: (()).chdir +: Process.times - Extended to take a block. + Moved from Time.times. (Time.times still remains but emits a + warning) -: (()).glob +: Process.waitall - Made to support meta-character escaping by a backslash. Wildcards - and spaces may now be escaped using a backslash. + Added. -: (())#all? -: (())#any? -: (())#inject +: Process::Status - Added. + Added. (({$?})) is now an instance of this class. -: (()).lchmod -: (()).lchown +: Range#step([step=1]) Added. -: (()).for_fd +: Range#to_ary - Added. + Added. You can now do something like this: -: (()).read + a, b, c = 1..3 - Added. (()) +: Regexp -: (()) + It is being obsoleted to regard /re/ as /re/ =~ $_ in a conditional + context. Use ~/re/ instead. - Made a subclass of (()). (It was a subclass of - Exception in 1.6 and prior) +: Regexp#options -: (())#to_ary + Added. - Added for convenience of Regexp#match. (()) +: 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 -: (()).acos(x) -: (()).asin(x) -: (()).atan(x) -: (()).cosh(x) -: (()).sinh(x) -: (()).tanh(x) -: (()).hypot(x,y) + Added. Utility for direct Socket access. - Added. +: Socket.pack_sockaddr_un, Socket.unpack_sockaddr_un -: (())#included + Added. Utility for direct Socket access. - Added. This is a hook called after Module#append_feature. +: String#[regexp, nth] -: (())#method_removed -: (())#method_undefined + Extended to accepts optional second argument. - Added. + tries match between self and REGEXP, then returns the + content of the NTH regexp register. -: (()) +: String#casecmp - Added. (()) + Added. This is a case insensitive version of String#<=>. -: NotImplementError +: String#chomp - Finally obsoleted. Use (()). + if $/ == '\n', chops off last newlines (any of \n, \r, \r\n). -: (())#singleton_method_removed -: (())#singleton_method_undefined +: String#eql? - Added. + Changed to be always case sensitive. -: (())#== +: String#insert(n, other) Added. -: (()).times - - Moved from ((