Created
November 29, 2010 05:38
-
-
Save apotheon/719618 to your computer and use it in GitHub Desktop.
irb vs. rbx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ~> irb | |
| irb(main):001:0> foo = {:one => [0,1], :two => 2} | |
| => {:one=>[0, 1], :two=>2} | |
| irb(main):002:0> File.open('tempfile.txt', 'w') {|f| f.write foo.inspect } | |
| => 23 | |
| irb(main):003:0> bar = Hash.new | |
| => {} | |
| irb(main):004:0> File.open('tempfile.txt', 'r') {|f| bar = eval(f.read) } | |
| => {:one=>[0, 1], :two=>2} | |
| irb(main):005:0> p bar | |
| {:one=>[0, 1], :two=>2} | |
| => nil | |
| irb(main):006:0> exit | |
| ~> rbx | |
| irb(main):001:0> foo = {:one => [0,1], :two => 2} | |
| => {:one=>[0, 1], :two=>2} | |
| irb(main):002:0> File.open('tempfile.txt', 'w') {|f| f.write foo.inspect } | |
| => 23 | |
| irb(main):003:0> bar = Hash.new | |
| => {} | |
| irb(main):004:0> File.open('tempfile.txt', 'r') {|f| bar = eval(f.read) } | |
| => {:one=>[0, 1], :two=>2} | |
| irb(main):005:0> p bar | |
| {} | |
| => nil | |
| irb(main):006:0> exit | |
| ~> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment