Last active
May 17, 2019 10:06
-
-
Save 284km/1e5f105b810d5887064ddbb02f143771 to your computer and use it in GitHub Desktop.
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
class String | |
# def to_proc | |
def* to_proc | |
puts self | |
-> { self } | |
end | |
end | |
->(&b){b.()}.(&("Hello world" * 42)) | |
# It was a wonderful puzzle! Many thanks! | |
# I had the following experiences:) | |
# First of all, I did my best to make 1 with 4 and 2. | |
# "4*2", "4%2", "4.2"? I realized soon that this was impossible... | |
# Next, I thought that how can I destroy "* 42"? how can I destroy "* 42"? how can I destroy "* 42"? | |
# And I thought about the redefinition of the method as one way. | |
# I kept thinking. Let's redefine the asterisk! And write "def *". At that time, | |
# oh? Can I discard "42" as an argument? ( ゚д゚)ハッ! I can discard "42" as an argument! | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment