proc_obj = -> proto { print proto; puts("World")}
puts proc_obj["Hi"]
puts proc_obj.call("Hello") #Is this is the same as above
please refer me to some link to demystify this …
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What is happening to that lambda is that you’re calling its
[]method, which causes the lambda to be executed with the argument"Hi". And yes, callingcallis the same as calling[].