feat: replace new keyword with this constructor syntax and ClassName.new() calls across core library and docs

Replace all uses of the `new` reserved word with explicit `this new()` constructor definitions and `ClassName.new()` instantiation calls in builtin/core.wren. Update all documentation files (classes.markdown, fiber.markdown, fn.markdown, sequence.markdown, error-handling.markdown, expressions.markdown, fibers.markdown, functions.markdown) to reflect the new constructor syntax, removing `new` keyword examples and replacing them with `ClassName.new()` patterns and `this new()` definitions.
This commit is contained in:
Bob Nystrom
2015-07-10 16:18:22 +00:00
parent 121d39cb42
commit e19ff59cce
221 changed files with 864 additions and 654 deletions
@@ -20,4 +20,4 @@ class Bar is Foo {
}
}
(new Bar).test
Bar.new().test
@@ -18,6 +18,6 @@ class Foo {
}
}
(new Foo).test
Foo.new().test
// TODO: Need to decide how these interact with globals.
@@ -14,4 +14,4 @@ class Foo {
}
}
(new Foo).test
Foo.new().test
@@ -17,4 +17,4 @@ class Foo {
}
}
(new Foo).test
Foo.new().test
@@ -36,7 +36,7 @@ class Outer {
}
}
(new Inner).test
Inner.new().test
getter // expect: outer getter
setter = "value" // expect: outer setter
@@ -44,4 +44,4 @@ class Outer {
}
}
(new Outer).test
Outer.new().test