From: Hal Fulton Date: 2005-04-06T08:31:08+09:00 Subject: Re: [curiousity] why aren't declarations just syntactic sugar? Lionel Thiry wrote: > Hello! > > I'd like to know why in ruby, a construction like: > class MyClass > ... > end > > isn't just a syntactic sugar for: > MyClass = Class.new do > ... > end > > Is it a problem about block variable binding? Is it a problem of speed? > Something else? I've seen this discussed... I think it's just historical reasons first of all. I'm not sure this kind of unification was "thought of" at the beginning. But there are also other considerations, I think. For example, a block is a closure, whereas the body of a class definition is not. A question of scope. Hal