Skip to content

Commit

Permalink
* range.c (range_step): iteration done using "+" if elements are
Browse files Browse the repository at this point in the history
  Numeric.  Otherwise using "succ".

* range.c (range_each): iteration done using "succ".  If the
  elements does not respond to "succ", raise TypeError.  As a
  result, all Enumerable methods, e.g. collect, require elements
  to respond to "succ'.

* range.c (range_member): comparison done using "each", if
  elements are non-Numeric or no-"succ" objects.  Otherwise
  compare using "<=>".

* range.c (Init_Range): remove "size" and "length".


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed May 30, 2002
1 parent 21b2953 commit 34f5c40
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 183 deletions.
20 changes: 16 additions & 4 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
Thu May 30 12:52:42 2002 Yukihiro Matsumoto <[email protected]>

* range.c (range_step): iteration done using "+" if elements are
Numeric. Otherwise using "succ".

* range.c (range_each): iteration done using "succ". If the
elements does not respond to "succ", raise TypeError. As a
result, all Enumerable methods, e.g. collect, require elements
to respond to "succ'.

* range.c (range_member): comparison done using "each", if
elements are non-Numeric or no-"succ" objects. Otherwise
compare using "<=>".

* range.c (Init_Range): remove "size" and "length".

Thu May 30 09:16:36 2002 Wakou Aoyama <[email protected]>

* lib/cgi.rb: if StringIO is usable then use it.
Expand Down Expand Up @@ -46,10 +62,6 @@ Tue May 28 12:13:37 2002 Nobuyoshi Nakada <[email protected]>

* node.h (NEW_DASGN, NEW_DASGN_CURR): remove surplus semicolons.

Mon May 27 04:31:37 2002 Yukihiro Matsumoto <[email protected]>

* time.c (time_succ): new method for Range support.

Fri May 24 09:06:29 2002 Yukihiro Matsumoto <[email protected]>

* time.c (time_arg): nil test against v[6] (usec).
Expand Down
2 changes: 1 addition & 1 deletion eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -3851,7 +3851,7 @@ rb_yield_0(val, self, klass, pcall)
if (ruby_dyna_vars->id == 0) {
vars = ruby_dyna_vars->next;
rb_gc_force_recycle((VALUE)ruby_dyna_vars);
while (vars && vars->id != 0) {
while (vars && vars->id != 0 && vars != block->dyna_vars) {
struct RVarmap *tmp = vars->next;
rb_gc_force_recycle((VALUE)vars);
vars = tmp;
Expand Down
3 changes: 2 additions & 1 deletion lib/complex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,10 @@ module Math
alias sin! sin
alias tan! tan
alias log! log
alias atan! atan
alias log10! log10
alias atan2! atan2

def sqrt(z)
if Complex.generic?(z)
if z >= 0
Expand Down
Loading

0 comments on commit 34f5c40

Please sign in to comment.