Skip to content

Commit

Permalink
Explicitly state difference between 'new' and '__construct' functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Sainan authored and well-in-that-case committed Nov 17, 2024
1 parent 16317e6 commit 6e79a95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/New Features/Object-Oriented Programming.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ local john = new Human("John")
print(john.name) --> John
```

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(...)`.
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`.

## Class Statement

Expand Down

0 comments on commit 6e79a95

Please sign in to comment.