1 / 13

A Tour of ruby

A Tour of ruby. 2011 ACM Class, Dong Xie. What is Ruby?. Dynamic programming language Complex but expressive grammar A core class library with rich and powerful APIs Draws inspiration from Lisp , Smalltalk and Perl Easy for C and Java programmers to learn

bina
Download Presentation

A Tour of ruby

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A Tour of ruby 2011 ACM Class, Dong Xie

  2. What is Ruby? • Dynamicprogramming language • Complex but expressive grammar • A core class library with rich and powerful APIs • Draws inspiration from Lisp, Smalltalk and Perl • Easy for C and Java programmers to learn • Ruby is designed to make programmers happy. ——By Yukihiro Matsumoto

  3. Simplified Expressions • Optionalparentheses • Parallel assignment • Punctuation Suffixes and Prefixes

  4. Everything is an Object • Completelyobject-oriented language • Seeing Everything as an Object • even simple numeric literals and the values true, false and nil • Only single inheritance, the Mixin(Module)

  5. Everything has a value • NOdifference between expressionsand statements • Everything has a value, even if that value is nil • Even control structures have their own value such as if, while, etc.

  6. Classes are Open • Dynamic Programming Language • Not only dynamic-typed (like python, PHP, etc.) • Allows its users to freely alter its parts • Add, Remove, Redefine

  7. Singleton methods • Per-object methods • Only available on the Object you defined it on

  8. Iterators and Blocks • “A truly expressive feature” • Iterators —— loops • Blocks—— associate with a method invocation

  9. Procs and Lambdas • Class Proc, Kernel.Lambda • Functions that can be manipulated as objects • Block as a single parameter • Instances of class Proc as parameters

  10. And more… • Symbols are not lightweight strings • “Variable” constants • Fake keyword parameters • The universal truth • Missing methods • Metaprogramming capability • Packages —— RubyGems • ……

  11. To learn more… • Official Site: http://www.ruby-lang.org/en/ • Ruby in a Nutshell • The Ruby Programming Language • The Book of Ruby • Programming Ruby • Ruby Cookbook

  12. Q&A Any questions are welcomed…

  13. Thanks for Listening Contact: xiedong1993@gmail.com

More Related