R
Ralph Mason
One thing I have often wondered is why the ruby constructor isn't called
new?
In my laziness I would rather type new than initialize.
It seems clearer than initialize, and appears to work just fine.
Perhaps both could be supported?
What thoughts?
Ralph
class Foo
def new
puts "Foo.new"
end
def Foo.new
x=super
x.new
x
end
def bar
puts "Foo:bar"
end
end
Foo.new().bar
new?
In my laziness I would rather type new than initialize.
It seems clearer than initialize, and appears to work just fine.
Perhaps both could be supported?
What thoughts?
Ralph
class Foo
def new
puts "Foo.new"
end
def Foo.new
x=super
x.new
x
end
def bar
puts "Foo:bar"
end
end
Foo.new().bar