From: Saynatkari Date: 2005-04-06T11:08:38+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? > > Thanks in advance. I, I think that is a good idea. On the other hand, I also think that def foo(x) do_something_with x end Should be syntactic sugar for def(:name => :foo, :bind => binding, :body => {|x| do_something_with x} ) Then again, the current system works well too :) > Lionel Thiry E