diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-06-04 05:31:06 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-06-04 05:31:06 +0000 |
commit | 8a7dd341c13896960574b184e44a482966f73ddf (patch) | |
tree | 753271a9b5c91b528b011d0f8ec6632b541f0aab /doc | |
parent | 5a6ef901c24a9375c77b702b7a77b8116111e129 (diff) |
Add NEWS, in which we describe the changes that affect users.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'doc')
-rw-r--r-- | doc/NEWS | 350 |
1 files changed, 187 insertions, 163 deletions
@@ -1,261 +1,285 @@ -: Syntax +Summary of the changes since 1.6.3: - Experimentally altered to get the following code (note the space - after p): +: Hash#replace - p ("xx"*2).to_i + Fixed so the following code does not fail in core dump. - Interpreted as: + h = { 10 => 100, 20 => 200 } + h2 = { } - p (("xx"*2).to_i) - - Instead of: - - (p("xx"*2)).to_i - -: Range#to_ary - - Added. You can now do something like this: - - a, b, c = 1..3 + h.each { |k, v| + if (k == 10) + h.delete(10) + h2.replace(h) # => Abort core dumped + end + } -: break and next +: File::unlink - Extended to take an optional expression, which is used as a value - for termination. [experimental] + Changed to be forbidden under $SAFE >= 2. -: SHA1 module +: ruby -T4 - ruby-sha1 1.2 is newly imported as a standard library, which shares - a common interface with the existing md5 module. + Fixed. ARGV is now properly marked as tainted so ruby -T4 no longer + fails in SecurityError. -: MD5#<< +: Regexp - Added as an alias for MD5#update. + Fixed. Now \1 .. \9 always mean backreferences, and referring to + unclosed/unmatched parentheses always fails. -: to_str +: String taint infection - Added to get objects which define to_str() treated as String's. + Fixed for the following cases. [ruby-dev:13340] - Now almost all the built-in methods try each argument with to_str() - when they expect it to be a String. + # []= + s1 = "abc" + s2 = "cde".taint + s1[0]= s2 + p s1.tainted? # => false - 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] + # crypt + s = "abc".taint + p s.crypt("cd").tainted? # => false -: Line-range operation + # ljust + s = "abc".taint + p s.ljust(10).tainted? # => false - 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. + # rjust + s = "abc".taint + p s.rjust(10).tainted? # => false -: Comparison of exception classes in a rescue clause + # center + s = "abc".taint + p s.center(10).tainted? # => false - Changed to use ((<Module>))#=== for comparing $! with the exception - class specified in each rescue clause. + Now they will all be marked as tainted. - 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. +: rb_yield_0() -: ((<Array>))#fetch + Fixed so it adjusts a 1-element array when yielded from C API, as + well. Previously, the following code produced a wrong result: - Added. + class X + include Enumerable -: ((<Array>))#insert(n, other, ...) + def each(&block) + block.call(1) + block.call(2) + block.call(3) + end + end - Added. ((<ruby-talk:14289>)) + x = X.new + p x.to_a #=> [[1], [2], [3]] - This is much the same as (({ary[n,0] = [other,...]})) except - returing self. + Now it properly produces [1, 2, 3]. - ary = [0,1,2,3] - ary[2, 0] = [4, 5, 6] - p ary +: $SAFE - ary = [0,1,2,3] - ary.insert(2, 4, 5, 6) - p ary + Fixed so aliasing global valiables is disallowed under $SAFE = 4. + ((<ruby-dev:13287>)) -: ((<Array>))#sort! +: Open3::popen3 - Changed to always return self without checking whether the sequence - of the elements was modified or not. + Fixed to do exit! instead of exit so the dying process does not + invoke at_exit. ((<ruby-dev:13170>)) - Beware that this behavior is not guaranteed to continue in the - future. Do not rely on its return value. ((<ruby-dev:12506>)). +: SizedQueue#pop -: ((<Dir>)).open + Fixed so the following code does not cause a dead lock. + ((<ruby-dev:13169>)) - 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) + ruby -r thread -e 'q = SizedQueue.new(1); q.push(1);' + -e 'Thread.new{sleep 1; q.pop}; q.push(1);' -: ((<Dir>)).chdir +: SizedQueue#max= - Extended to take a block. + Fixed so it really works. ((<ruby-dev:13170>)) -: ((<Dir>)).glob +: Queue +: SizedQueue - Made to support meta-character escaping by a backslash. Wildcards - and spaces may now be escaped using a backslash. + Fixed to rescue ThreadError in case the thread is dead just before + calling Thread#run. ((<ruby-dev:13194>)) -: ((<Enumerable>))#all? -: ((<Enumerable>))#any? -: ((<Enumerable>))#inject +: Array#& +: Array#| +: Array#uniq - Added. + Fixed so they do not freeze the elements. ((<ruby-list:29665>)) -: ((<File>)).lchmod -: ((<File>)).lchown + (%w(foo bar) & %w(foo baz))[0].upcase! + => -:1:in `upcase!': can't modify frozen string (TypeError) - Added. + %w(foo bar bar baz).uniq[0].upcase! + => -:1:in `upcase!': can't modify frozen string (TypeError) -: ((<IO>)).for_fd +: shell.rb - Added. + shell.rb 0.6 is newly imported as a standard library, along with + documents. -: ((<IO>)).read +: forwardable.rb - Added. ((<ruby-talk:9460>)) + forwardable.rb 1.1 is newly imported as a standard library, along with + documents. -: ((<Interrupt>)) +: irb & irb-tools - Made a subclass of ((<SignalException>)). (It was a subclass of - Exception in 1.6 and prior) + irb and irb-tolls are updated to 0.7.4 and 0.7.1, respectively. -: ((<MatchData>))#to_ary +: Daylight saving time - Added for convenience of Regexp#match. ((<ruby-dev:12766>)) + Fixed so it is handled correctly. [ruby-bugs-ja (PR#46)] - Previously we had to do: + env TZ=America/Managua ruby -e 'p Time.local(1998,12,1,0,59,59)' + => Mon Nov 30 01:59:59 EST 1998 + env TZ=America/Managua ruby -e 'p Time.local(1998,12,1,0,59,59).tv_sec' + => 912409199 - foo, bar, baz = /(\w+?)\s+(\w+?)\s+(\w+)/.match("foo bar baz").to_a[1..-1] - p [foo, bar, baz] +: SIGINFO - But now can do: + Support SIGINFO of 4.4BSD. [ruby-bugs-ja (PR#45)] - _, foo, bar, baz = /(\w+?)\s+(\w+?)\s+(\w+)/.match("foo bar baz") - p [foo, bar, baz] +: Modifier rescue -: ((<Math>)).acos(x) -: ((<Math>)).asin(x) -: ((<Math>)).atan(x) -: ((<Math>)).cosh(x) -: ((<Math>)).sinh(x) -: ((<Math>)).tanh(x) -: ((<Math>)).hypot(x,y) + Fixed so the following code does not emit a parse error any more. + ((<ruby-dev:13073>)), ((<ruby-dev:13292>)) - Added. + raise "" rescue [] + raise "" rescue (p "foo"; true) + raise "" rescue -1 + raise "" rescue (-1) -: ((<Module>))#included +: Thread - Added. This is a hook called after Module#append_feature. + Fixed so the following code does not cause a dead lock any more. -: ((<Module>))#method_removed -: ((<Module>))#method_undefined + Thread.start { Thread.stop } + sleep - Added. + => deadlock 0x40199b58: 2:0 - -:1 + deadlock 0x401a2528: 2:4 (main) - -:2 + -:2:in `sleep': Thread: deadlock (fatal) + from -:2 + ruby 1.6.3 (2001-03-19) [i586-linux] -: ((<NoMethodError>)) +: Module#const_defined? +: Module#const_get +: Module#const_set - Added. ((<ruby-dev:12763>)) + Fixed so they do not access to anything other than constants. + ((<ruby-dev:13019>)) -: NotImplementError +: Marshal.dump - Finally obsoleted. Use ((<NotImplementedError>)). + Improved so it dumps Float with better precision: "%.12g" -> "%.16g" + ((<ruby-list:29349>)) -: ((<Object>))#singleton_method_removed -: ((<Object>))#singleton_method_undefined +: Fixnum#[] - Added. + Fixed a bug on the platforms which sizeof(long) > sizeof(int). -: ((<Proc>))#== +: Regular Expression - Added. + Fixed a couple of minor bugs. ((<ruby-talk:13658>)), ((<ruby-talk:13744>)) -: ((<Process>)).times +: retry - Moved from ((<Time>)).times. (Time.times still remains but emits a - warning) + Fixed so the following code works correctly again. ((<ruby-talk:13957>)) -: ((<Process::Status>)) + def WHILE(cond) + return if not cond + yield + retry + end - Added. (({$?})) is now an instance of this class. + i=0 + WHILE(i<3) { + print i + i+=1 + } -: ((<Process>)).waitall + ruby 1.6.2 (2000-12-25) [i586-linux] + => 012 - Added. + ruby 1.6.3 (2001-03-19) [i586-linux] + => 0 -: ((<Regexp>)).last_match(n) + ruby 1.6.4 (2001-05-02) [i586-linux] + => 012 - Extended to take an optional argument. +: ((<File::Stat>))#size -: ((<Regexp>))#options + Fixed to return a correct value for files larger than 1G bytes. - Added. + File.open("/tmp/1GB", "w") {|f| + f.seek(2**30-1, 0) + f.puts + f.flush + p f.stat.size + } -: ((<String>))#insert(n, other) + # => ruby 1.6.3 (2001-04-03) [i586-linux] + -1073741824 + # => ruby 1.6.4 (2001-04-19) [i586-linux] + 1073741824 - Added. +: ((<Float>))#modulo, ((<Float>))#divmod - This is much the same as (({str[n, 0] = other})) except returing - self. + Fixed. ((<ruby-dev:12718>)) -: ((<Symbol>)).all_symbols +: ((<ObjectSpace>))#_id2ref - Added. ((<ruby-dev:12921>)) + Fixed so it does not raise a exception. -: ((<Symbol>))#intern +: recursive malloc problem - Added. + Fixed by preallocating a buffer for stdio using setvbuf(). + ((<ruby-dev:12795>)) -: ((<SystemCallError>)).=== +: ((<File>))#flock - Added. (See the "Comparison of exception classes in a rescue clause" - paragraph above) ((<ruby-dev:12670>)) + Fixed so it does not raise Errno::EACCES when the file to flock is + already locked. (only applicable to the platforms which lack + flock()) -: ((<SystemExit>))#status +: ((<File::Stat>)).new(filename) - Added. + Added. ((<ruby-dev:12803>)) -: ((<TCPSocket>)).new -: ((<TCPSocket>)).open +: ((<Bignum>))#% miscalculation - Extended to take an address and a port number for the local side in - optional 3rd and 4th arguments. + (Re-)Fixed. -: ((<Time>)) + a = 677330545177305025495135714080 + b = 14269972710765292560 + p a % b #=> 0 + p -a % b #=> - Extended to accept a negative time_t. (Only when the platform - supports it) + => ruby 1.6.3 (2001-04-02) [i386-cygwin] + 0 + 14269972710765292560 - p Time.at(-1) - => Thu Jan 01 08:59:59 JST 1970 + => ruby 1.6.4 (2001-04-19) [i586-linux] + 0 + 0 -: ((<Time>))#to_a -: ((<Time>))#zone +: ((<Marshal>)) - Made to return "UTC" under gmtime. It used to return a platform - dependent value, typically "GMT", in 1.6 and prior. + Fixed so a Bignum is properly restored through dump & load. -To be investigated: +: Universal Naming Convention(UNC) support (win32) - Sat Feb 24 03:15:49 2001 Yukihiro Matsumoto <matz@ruby-lang.org> + Added. Now the UNC form (//host/share) is supported. Use slash + (`(({/}))') instead of backslash (`(({\}))') for separating + components. - * io.c (set_stdin): preserve original stdin. +: ((<Dir>)).glob (win32) - * io.c (set_outfile): preserve original stdout/stderr. + Fixed so it works for the current directory as well. + p Dir["./*.c"] + => [] |