Keywords

 
   

Ruby Way
By Hal Fulton
Slots : 1.0
Table of Contents
 


Both Ruby and Python have these keywords: and, break, class, def, else, for, if, in, not, or, return, and while. The keyword def is used only for method definitions, and in is used only with for loops, not conditionals (use include? for that purpose).

Ruby has additional keywords not listed here. It does not have: assert, continue, del, elif, except, exec, finally, from, global, import, is, lambda, pass, print, raise, or try as keywords. You can use next in place of continue, and begin/rescue/ensure in place of try/except/finally. You will see exec, lambda, print, and raise as built-in methods in Ruby.


   

 

 



The Ruby Way
The Ruby Way, Second Edition: Solutions and Techniques in Ruby Programming (2nd Edition)
ISBN: 0672328844
EAN: 2147483647
Year: 2000
Pages: 119
Authors: Hal Fulton

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net