Skip to content

Commit 6e79a95

Browse files
Sainanwell-in-that-case
authored andcommitted
Explicitly state difference between 'new' and '__construct' functions
1 parent 16317e6 commit 6e79a95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/New Features/Object-Oriented Programming.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ local john = new Human("John")
5353
print(john.name) --> John
5454
```
5555

56-
Note that for compatibility with Lua and C API classes, the `new` operator checks for the existence of a static 'new' function. If it exists, `new X(...)` will be identical to `X.new(...)`.
56+
Note that for compatibility with Lua and C API classes, the `new` operator checks for the existence of a static `new` function. If it exists, `new X(...)` will be identical to `X.new(...)`. In contrast to `__construct`, there is no 'self' argument given to `new`.
5757

5858
## Class Statement
5959

0 commit comments

Comments
 (0)