diff options
Diffstat (limited to 'doc/manual.txt')
-rwxr-xr-x | doc/manual.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/manual.txt b/doc/manual.txt index e5814b9d6..c8d40c476 100755 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -795,6 +795,19 @@ values to use: As can be seen from the example, it is possible to both specify a field's ordinal value and its string value by using a tuple. It is also possible to only specify one of them. + +An enum can be marked with the ``pure`` pragma so that it's fields are not +added to the current scope, so they always need to be accessed +via ``TMyEnum.value``: + +.. code-block:: nimrod + + type + TMyEnum {.pure.} = enum + valueA, valueB, valueC, valueD + + echo valueA # error: Unknown identifier + echo TMyEnum.valueA # works String type |