Afficher un message
Vieux 23/05/2008, 03h18   #1
APNelson.L
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Lambda Block vs. Method

I was just wondering what the benefit would be of creating a block
that can be called rather than defining a method. Here is an example:

def puts_time(x)
puts x
end

instead of...

puts_time = lambda { |x| puts x }

personally I see no reason to create a block like this instead of a
method.
  Réponse avec citation
 
Page generated in 0,05023 seconds with 9 queries