Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ruby 2.0 - A Swift Introduction

Ruby 2.0 - A Swift Introduction

Slides for the Ruby 2.0 talk I gave at the Amsterdam.rb meetup. Find the code examples at https://github.com/lukasspee/amsrb-talk-ruby2.

Lukas Spee

June 17, 2013
Tweet

Other Decks in Programming

Transcript

  1. Off we go... A happy little update Mostly backwards compatible

    Current stable OpenSSL on OSX Outdated Tuesday, June 18, 13
  2. Under the Hood Garbage Collector RegExp Engine: Onigmo YAML Parser:

    Syck ‛ Psych Kernel#require optimized Tuesday, June 18, 13
  3. Encoding Default UTF-8 # encoding: utf-8 puts "I've got €

    20 in my pocket." ‛ puts "I've got € 20 in my pocket." Iconv deprecated: Iconv.conv(“utf-8”, “ascii”, “hello”) ‛ “hello”.encode(“utf-8”, “ascii”) Tuesday, June 18, 13
  4. %i %i(blinky pinky inky clyde) #=> [:blinky, :pinky, :inky, :clyde]

    why = "y" ; %I(blink#{why} pink#{why} ink#{why} cl#{why}de) #=> [:blinky, :pinky, :inky, :clyde] Tuesday, June 18, 13
  5. Enumerable#lazy Iterate over (potentially) infinite streams without getting stuck in

    an endless loop Often slow, use with care http://patshaughnessy.net/2013/4/3/ruby-2-0-works-hard-so-you-can-be- lazy Tuesday, June 18, 13
  6. Lazy #size For Enumerator and Range (0..9).size #=> 10 loop.size

    #=> Infinity Returns nil when lazy evaluation is not possible Tuesday, June 18, 13