On May 18, 2006, at 23:39 , Joe Bowers wrote:

> Partials are great for deferring part of a computation
> until later- they're useful in some of the same circumstances
> as closures. They're also really easy to use in ruby already.
>
>   def multiply(x, y); x * y; end
>
>   multiply_by_3 = lambda { |x| multiply(3, x) }

I've been keen to learn more about closures, but haven't made the  
time to do so. I just did something I think might be similar to this  
yesterday. To use the running example, instead of using the closure,  
I defined

def multiply_by_3(x)
	multiply(3,x)
end

I'm using this in a class as an instance method. As I understand it,  
if I were to use the closure syntax, I'd do

def multiply_by_3(x)
	lamda { |x| multiply(3,x) }
end

Am I following correctly? Or is this an opportunity for me to hit the  
books?

Michael Glaesemann
grzm seespotcode net