mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-15 23:54:19 +00:00
Merge pull request #3176 from zielmicha/ofoperator
Improve discoverability of 'of' operator
This commit is contained in:
@@ -588,7 +588,8 @@ can also be defined with indentation instead of ``[]``:
|
||||
|
||||
Objects provide many features that tuples do not. Object provide inheritance
|
||||
and information hiding. Objects have access to their type at runtime, so that
|
||||
the ``of`` operator can be used to determine the object's type.
|
||||
the ``of`` operator can be used to determine the object's type. The ``of`` operator
|
||||
is similar to the ``instanceof`` operator in Java.
|
||||
|
||||
.. code-block:: nim
|
||||
type
|
||||
|
||||
@@ -487,6 +487,7 @@ type
|
||||
## See the full `exception hierarchy`_.
|
||||
ObjectConversionError* = object of Exception ## \
|
||||
## Raised if an object is converted to an incompatible object type.
|
||||
## You can use ``of`` operator to check if conversion will succeed.
|
||||
##
|
||||
## See the full `exception hierarchy`_.
|
||||
FloatingPointError* = object of Exception ## \
|
||||
|
||||
Reference in New Issue
Block a user