Skip to content

Commit 1df061c

Browse files
committed
Merge pull request #8587 from dletozeun/patch-1
Update modules.rst
2 parents 1a4c02f + bb44212 commit 1df061c

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

doc/manual/modules.rst

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -91,23 +91,24 @@ To load a module, two main keywords can be used: ``using`` and ``import``. To un
9191

9292
In this module we export the ``x`` and ``y`` functions (with the keyword ``export``), and also have the non-exported function ``p``. There are several different ways to load the Module and its inner functions into the current workspace:
9393

94-
+------------------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------------------------+
95-
|Import Command | What is brought into scope | Available for method extension |
96-
+====================================+==============================================================================================+========================================================================+
97-
| ``using MyModule`` | All ``export`` ed names (``x`` and ``y``), ``MyModule.x``, ``MyModule.y`` and ``MyModule.p`` | ``MyModule.x``, ``MyModule.y`` and ``MyModule.p`` |
98-
+------------------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------------------------+
99-
| ``using MyModule.x, MyModule.p`` | ``x`` and ``p`` | |
100-
+------------------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------------------------+
101-
| ``using MyModule: x, p`` | ``x`` and ``p`` | |
102-
+------------------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------------------------+
103-
| ``import MyModule`` | ``MyModule.x``, ``MyModule.y`` and ``MyModule.p`` | ``MyModule.x``, ``MyModule.y`` and ``MyModule.p`` |
104-
+------------------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------------------------+
105-
| ``import MyModule.x, MyModule.p`` | ``x`` and ``p`` | ``x`` and ``p`` |
106-
+------------------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------------------------+
107-
| ``import MyModule: x, p`` | ``x`` and ``p`` | ``x`` and ``p`` |
108-
+------------------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------------------------+
109-
| ``importall MyModule`` | All ``export`` ed names (``x`` and ``y``) | ``x`` and ``y`` |
110-
+------------------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------------------------+
94+
+------------------------------------+-------------------------------------+---------------------------------------------------+
95+
|Import Command | What is brought into scope | Available for method extension |
96+
+====================================+=====================================+===================================================+
97+
| ``using MyModule`` | ``x``, ``y``, ``MyModule.*`` | ``MyModule.*`` |
98+
+------------------------------------+-------------------------------------+---------------------------------------------------+
99+
| ``using MyModule.x, MyModule.p`` | ``x``, ``p``, ``MyModule.*`` | ``MyModule.*`` |
100+
+------------------------------------+-------------------------------------+---------------------------------------------------+
101+
| ``using MyModule: x, p`` | ``x``, ``p``, ``MyModule.*`` | ``MyModule.*`` |
102+
+------------------------------------+-------------------------------------+---------------------------------------------------+
103+
| ``import MyModule`` | ``MyModule.*`` | ``MyModule.*`` |
104+
+------------------------------------+-------------------------------------+---------------------------------------------------+
105+
| ``import MyModule.x, MyModule.p`` | ``x``, ``p``, ``MyModule.*`` | ``x``, ``p``, ``MyModule.*`` |
106+
+------------------------------------+-------------------------------------+---------------------------------------------------+
107+
| ``import MyModule: x, p`` | ``x``, ``p``, ``MyModule.*`` | ``x``, ``p``, ``MyModule.*`` |
108+
+------------------------------------+-------------------------------------+---------------------------------------------------+
109+
| ``importall MyModule`` | ``x``, ``y``, ``MyModule.*`` | ``x``, ``y``, ``MyModule.*`` |
110+
+------------------------------------+-------------------------------------+---------------------------------------------------+
111+
Note: In all cases, ``MyModule.*`` (i.e. ``MyModule.x``, ``MyModule.y`` and ``MyModule.p``) are loaded into current workspace and it is possible to add methods to them.
111112

112113

113114
Modules and files

0 commit comments

Comments
 (0)