Make constructors just methods.
* Eliminate "new" reserved word. * Allow "this" before a method definition to define a constructor. * Only create a default constructor for classes that don't define one.
This commit is contained in:
@@ -7,4 +7,4 @@ class InfiniteSequence is Sequence {
|
||||
}
|
||||
|
||||
// Should not try to iterate the whole sequence.
|
||||
IO.print((new InfiniteSequence).isEmpty) // expect: false
|
||||
IO.print(InfiniteSequence.new().isEmpty) // expect: false
|
||||
|
||||
Reference in New Issue
Block a user