Blocks, procs and lambdas. 9/21


#1



Good morning.
I don't understand what is wrong with my code.


Replace this line with your code. 
def bonjour
yield
end
phrase = Proc.new do
puts "Bonjour !" 
end
[bonjour].select(&phrase)



**Oups, merci de réessayer. Il semble que vous n'affichez rien en console. Avez-vous appelé votre méthode en lui passant la proc phrase ?**

Thank you for your future help.


#2

Hi there snakefinger33gmail.c ,

I figured it out, you actually puts "Hello there!" then when you call it, you put phrase in the [bonjour].select part.

Like this:

def greeter ()
yield
end

phrase = Proc.new do
puts "Hello there!"
end

[phrase].select(&phrase)


#3

I hope it helped with you.


#4

Hi ck43321 and thanks a lot.


#5

Hey,

Thank you ck43321 for the last line: [phrase].select(&phrase) which allowed me to move to the next lesson, but I'm still not clear with the behaviour.

The result is good, but it feels like we aren't calling the greeter method here,or am I wrong?