-
-
Save locks/9ba30711dd66f51b2b1a 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