mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
fix manual entry for .this pragma [ci skip]
This commit is contained in:
@@ -2383,7 +2383,8 @@ Automatic self insertions
|
||||
Starting with version 0.14 of the language, Nim supports ``field`` as a
|
||||
shortcut for ``self.field`` comparable to the `this`:idx: keyword in Java
|
||||
or C++. This feature has to be explicitly enabled via a ``{.this: self.}``
|
||||
statement pragma. This pragma is active for the rest of the module:
|
||||
statement pragma (instead of ``self`` any other identifier can be used too).
|
||||
This pragma is active for the rest of the module:
|
||||
|
||||
.. code-block:: nim
|
||||
type
|
||||
@@ -2398,10 +2399,6 @@ statement pragma. This pragma is active for the rest of the module:
|
||||
# is rewritten to:
|
||||
# result = self.parentField + self.childField
|
||||
|
||||
Instead of ``self`` any other identifier can be used too, but
|
||||
``{.this: self.}`` will become the default directive for the whole language
|
||||
eventually.
|
||||
|
||||
In addition to fields, routine applications are also rewritten, but only
|
||||
if no other interpretation of the call is possible:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user