Created
June 19, 2014 16:32
-
-
Save tenderlove/958999ab4240b93bd3cd to your computer and use it in GitHub Desktop.
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
# Make sure to do detection so it will gracefully downgrade like: | |
# begin | |
require 'psych' | |
Psych.add_domain_type(nil, 'code') { |_,hash| | |
p hash['ruby'] | |
} | |
# rescue | |
# do 1.8 stuff | |
# end | |
Psych.load DATA.read | |
__END__ | |
--- | |
lambda: !code | |
ruby: 'proc { "world" }' | |
perl: 'sub { "world" }' | |
js: 'function() { return "world" }' | |
php: 'return "world";' | |
python: 'lambda: "world"' | |
clojure: '(fn [] "world")' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment