From: Hal Fulton Date: 2006-08-25T08:25:59+09:00 Subject: Re: do not understand this closure rak rok wrote: >> >> I think it's difficult. Ruby distinguishes between method names >> and variable names by how they are used. In this case, you'd be >> using the same name both ways. > > > > Perhaps this could be an rcr? I'm having trouble seeing why Ruby would > impose a syntactic difference between a proc and a method call. It > would be > nice syntactic sugar IMO. I just tried to explain why. A proc is stored in a variable. A variable can't have () after it, because it will look like a method call. It's *conceivable* this could be changed, but then people would (accidentally or on purpose) try to "call" a variable that didn't refer to a proc: a = 5 a() Then Ruby would have to be smart enough to call the method a rather than trying to call the proc that isn't referred to by a. Furthermore, suppose you have both. Which takes precedence? def say puts "hello" end say = proc { puts "goodbye" } say() # hello or goodbye? Cheers, Hal