diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2021-02-04 05:09:53 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-04 14:09:53 +0100 |
commit | 534a95aee02c7eb4ebc731431b31d82192025631 (patch) | |
tree | 1b6acb48d25d8af3a81d32c34070d46062842d54 | |
parent | cccf219cebfafbf1913dfdfdce70d285127bc440 (diff) | |
download | Nim-534a95aee02c7eb4ebc731431b31d82192025631.tar.gz |
nep1: prefer `self` to `this` (#16927)
-rw-r--r-- | doc/nep1.rst | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/doc/nep1.rst b/doc/nep1.rst index 73e4d8433..e1d877816 100644 --- a/doc/nep1.rst +++ b/doc/nep1.rst @@ -162,10 +162,13 @@ to keep the names short but meaningful. ------------------- ------------ -------------------------------------- English word To use Notes ------------------- ------------ -------------------------------------- -initialize initT ``init`` is used to create a - value type ``T`` -new newP ``new`` is used to create a - reference type ``P`` +initialize initFoo initializes a value type ``Foo`` +new newFoo initializes a reference type ``Foo`` + via ``new`` +this or self self for method like procs, e.g.: + `proc fun(self: Foo, a: int)` + rationale: `self` is more unique in english + than `this`, and `foo` would not be DRY. find find should return the position where something was found; for a bool result use ``contains`` |