Created
December 20, 2018 12:27
-
-
Save glurp/dd77b301c5b8e0bec29c1ea51c87c8e5 to your computer and use it in GitHub Desktop.
execute and print ruby instructions
This file contains 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
str=<<'EEOF' | |
"a,b,c,d".split(/,/) | |
"a,bb,c".scan(/\w+/) | |
[1,2,3].inspect | |
[1,2,3].join(",") | |
Hash[1,2,3,4] | |
h=[1,2,3,4,5,6,7,8].group_by {|v| v%4} | |
h.to_a() | |
h.keys() | |
h.values() | |
EEOF | |
h=nil | |
str.lines.each {|l|l.strip!; print "Eval of #{l} \t: "; p eval(l) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment