From cd5127b7d8cf781bc93f05177ce1083b6560fe82 Mon Sep 17 00:00:00 2001 From: Kritphong Mongkhonvanit Date: Fri, 17 Jul 2026 20:53:19 +0700 Subject: [PATCH 1/3] Docs: Add an entry for "import" in the dictionary --- apps/docs/autogen/data/dictionary.yaml | 53 ++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/apps/docs/autogen/data/dictionary.yaml b/apps/docs/autogen/data/dictionary.yaml index bf139ba8..ba33902c 100644 --- a/apps/docs/autogen/data/dictionary.yaml +++ b/apps/docs/autogen/data/dictionary.yaml @@ -3508,6 +3508,59 @@ entries: - code: ifelse-value *boolean1* [ *reporter1* ] [ *elsereporter* ] - code: (ifelse-value *boolean1* [ *reporter1* ] *boolean2* [ *reporter2* ] ... [ *elsereporter* ]) since: "6.1" + - id: import + entry_categories: + - title: Keyword + id: keywords + data: + syntax: + - name: import + since: "7.1" + description: |+ + Make the procedures in the given module available for use in the + current file. The file name of the module file (with the `.nls` suffix) + must be a valid NetLogo name, so there can be no space in the name. + + For example: + + ``` + import utils + ``` + + This will import procedures in "utils.nls" in the same directory as the + current file and make them available with a "utils:" prefix. As an example, + if there is a reporter called `add` in "utils.nls", then it will be made + available for use under the name `utils:add`. + + The prefix can be changed as follows: + + ``` + import utils as u + ``` + + This will instead make `add` available as `u:add`. + + It is also possible to selectively import a subset of procedures or + reporters from a module, for example: + + ``` + import [add subtract] from utils + ``` + + This will make `add` and `subtract` available in the current file. Note + that no prefix is added when a module is imported this way. + + Imported procedures and reporters can be renamed as follows: + + ``` + import [add (subtract as sub)] from utils + ``` + + This will instead make `subtract` available as `sub`. + + examples: + - code: import *module* as *prefix* + - code: import [ *names* ] from *module* - id: import-drawing entry_categories: - title: Input/Output From 5deee9014993f7c27c77b772593bc37dcee0bd63 Mon Sep 17 00:00:00 2001 From: Kritphong Mongkhonvanit Date: Tue, 21 Jul 2026 21:25:22 +0700 Subject: [PATCH 2/3] Docs: Add an entry for "export" in the dictionary --- apps/docs/autogen/data/dictionary.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/docs/autogen/data/dictionary.yaml b/apps/docs/autogen/data/dictionary.yaml index ba33902c..400a5a23 100644 --- a/apps/docs/autogen/data/dictionary.yaml +++ b/apps/docs/autogen/data/dictionary.yaml @@ -1898,6 +1898,19 @@ entries: examples: - code: exp *number* + - id: export + entry_categories: + - title: Keyword + id: keywords + data: + syntax: + - name: export + since: "7.1" + description: |+ + Make the given names available for importing. This command is only + valid in an NLS file. See [[import|import]] for more information. + examples: + - code: export [ *names* ] - id: export-cmds entry_categories: - title: Input/Output From 1bda673fa6788c3d606bfedd7a54d97cbdcd7403 Mon Sep 17 00:00:00 2001 From: Kritphong Mongkhonvanit Date: Fri, 17 Jul 2026 20:53:53 +0700 Subject: [PATCH 3/3] Docs: Add "import" and "export" to the list of keywords --- apps/docs/autogen/programming.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/docs/autogen/programming.md b/apps/docs/autogen/programming.md index bc6b03b9..9f01669e 100644 --- a/apps/docs/autogen/programming.md +++ b/apps/docs/autogen/programming.md @@ -945,9 +945,10 @@ unfamiliar to some readers. #### Keywords The only keywords in the language are [[globals]], [[breed]], [[turtles-own]], -[[patches-own]], [[to]], [[to-report]], and [[end]], plus [[extensions]] and the -experimental [[__includes|includes]] keyword. (Built-in primitive names may not be -shadowed or redefined, so they are effectively a kind of keyword as well.) +[[patches-own]], [[to]], [[to-report]], [[end]], [[import]], and [[export]], +plus [[extensions]] and the experimental [[__includes|includes]] keyword. +(Built-in primitive names may not be shadowed or redefined, so they are +effectively a kind of keyword as well.) #### Identifiers