Created
October 7, 2015 10:15
-
-
Save inglesp/c51900daed682699e29d to your computer and use it in GitHub Desktop.
NIGHTMARES
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 | |
| 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 | |
| π±π±π± |
Author
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
<<-EOFmeans 'everything on the next line until you get the lineEOF'. So that reduces toThen
ais just a function with a default value that is a symbol representing a function defined on the kernel:Test: