diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-05-06 06:29:39 -0700 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-05-06 06:29:39 -0700 |
| commit | 4edfe3bc379ffd42ea56108582316a98bf142101 (patch) | |
| tree | fe022811a83ef98bfecfbf4250e42a7cae034329 /mrblib/kernel.rb | |
| parent | 4f9a7e90adf0bdd77e7971d5066834c68eac33b0 (diff) | |
| parent | 1906d6eb33ea7e9643a7f506b83c13bcccf133dd (diff) | |
| download | mruby-4edfe3bc379ffd42ea56108582316a98bf142101.tar.gz mruby-4edfe3bc379ffd42ea56108582316a98bf142101.zip | |
Merge pull request #101 from bovi/master
Add documentation for Hash, Kernel, Numeric, Array and Range
Diffstat (limited to 'mrblib/kernel.rb')
| -rw-r--r-- | mrblib/kernel.rb | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/mrblib/kernel.rb b/mrblib/kernel.rb index c09755d6c..f98284d24 100644 --- a/mrblib/kernel.rb +++ b/mrblib/kernel.rb @@ -1,21 +1,33 @@ +## +# Kernel # -# Kernel -# +# ISO 15.3.1 module Kernel - # 15.3.1.2.6 + + ## + # Takes the given block, create a lambda + # out of it and +call+ it. + # + # ISO 15.3.1.2.6 def self.lambda(&block) ### *** TODO *** ### block # dummy end - # 15.3.1.2.8 + ## + # Calls the given block repetitively. + # + # ISO 15.3.1.2.8 def self.loop #(&block) while(true) yield end end - # 15.3.1.3.4 + ## + # Alias for +send+. + # + # ISO 15.3.1.3.4 def __send__(symbol, *args, &block) ### *** TODO *** ### end @@ -25,20 +37,31 @@ module Kernel ### *** TODO *** ### end - # 15.3.1.3.27 + ## + # Alias for +Kernel.lambda+. + # + # ISO 15.3.1.3.27 def lambda(&block) ### *** TODO *** ### block # dummy end - # 15.3.1.3.29 + ## + # Alias for +Kernel.loop+. + # + # ISO 15.3.1.3.29 def loop #(&block) while(true) yield end end - # 15.3.1.3.44 + ## + # Invoke the method with the name +symbol+ on + # the receiver and pass +args+ and the given + # block. + # + # ISO 15.3.1.3.44 def send(symbol, *args, &block) ### *** TODO *** ### end |
