diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-05-02 10:12:11 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-05-02 10:12:11 +0900 |
| commit | af2ceeb5bf535d0bd0c98f91f8fb99ada638d6a1 (patch) | |
| tree | b93c0c38e6cf0bbfab06dbac1393a62b662d997b | |
| parent | 39cf53d0288895aa46a9c81e2d112759f1d7ac57 (diff) | |
| parent | 9b39ce33c0601e707f24028ee5b8085db9d31c60 (diff) | |
| download | mruby-af2ceeb5bf535d0bd0c98f91f8fb99ada638d6a1.tar.gz mruby-af2ceeb5bf535d0bd0c98f91f8fb99ada638d6a1.zip | |
Merge branch 'master' of github.com:mruby/mruby
| -rw-r--r-- | mrblib/numeric.rb | 25 | ||||
| -rw-r--r-- | src/vm.c | 2 |
2 files changed, 20 insertions, 7 deletions
diff --git a/mrblib/numeric.rb b/mrblib/numeric.rb index ee5bdcb56..08600b0bf 100644 --- a/mrblib/numeric.rb +++ b/mrblib/numeric.rb @@ -1,8 +1,14 @@ -# -# Integer -# +## +# Integer +# +# ISO 15.2.8 class Integer - # 15.2.8.3.15 + + ## + # Calls the given block once for each Integer + # from +self+ downto +num+. + # + # ISO 15.2.8.3.15 def downto(num, &block) raise TypeError, "expected Integer" unless num.kind_of? Integer i = self @@ -13,7 +19,10 @@ class Integer self end - # 15.2.8.3.22 + ## + # Calls the given block +self+ times. + # + # ISO 15.2.8.3.22 def times(&block) i = 0 while(i < self) @@ -23,7 +32,11 @@ class Integer self end - # 15.2.8.3.27 + ## + # Calls the given block once for each Integer + # from +self+ upto +num+. + # + # ISO 15.2.8.3.27 def upto(num, &block) raise TypeError, "expected Integer" unless num.kind_of? Integer i = self @@ -299,7 +299,7 @@ localjump_error(mrb_state *mrb, const char *kind) #define SET_SYM_VALUE(r,v) {\ (r).tt = MRB_TT_SYMBOL;\ - (r).value.i = (v);\ + (r).value.sym = (v);\ } #define SET_OBJ_VALUE(r,v) {\ |
