Created
October 7, 2015 10:15
-
-
Save inglesp/c51900daed682699e29d to your computer and use it in GitHub Desktop.
NIGHTMARES
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
$ irb | |
2.2.2 :001 > def a l = def b; <<-NIGHTMARES; end; puts send l; end | |
2.2.2 :002"> 😱😱😱 | |
2.2.2 :003"> NIGHTMARES | |
=> :a | |
2.2.2 :004 > a | |
😱😱😱 |
Aha, thanks. I was baffled by what the heredoc was doing, and I'd forgotten that you don't need parentheses around a function's parameters.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think
<<-EOF
means 'everything on the next line until you get the lineEOF
'. So that reduces toThen
a
is just a function with a default value that is a symbol representing a function defined on the kernel:Test: