From 54b3131573590d713b1f2a72b7a366601d052d32 Mon Sep 17 00:00:00 2001 From: Travis CI <> Date: Fri, 16 Apr 2021 18:14:10 +0000 Subject: [PATCH] Deploy to GitHub Pages: --- modularity.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modularity.html b/modularity.html index 8f68fed5..42c262f3 100644 --- a/modularity.html +++ b/modularity.html @@ -375,6 +375,17 @@ var B = "b variable"

This sounds super hairy, but that’s because cyclic dependencies are hairy in general. The key point here is that Wren can handle them in the rare cases where you need them.

+

Exiting a module early #

+

Although the return statement is normally used to exit from a method or a function, it can also be used from a module’s top-level code to exit the module. For example, if the script consists of a single module, this code would exit the module (and therefore the script) early:

+
+for (i in 1..2) {
+  if (i == 2) return
+  System.print(i)  //>  prints 1 but not 2
+}
+System.print(3)    //>  not reached
+
+ +

Although it is not invalid to return a value, there is no way to access that value and it is therefore simply discarded.



← Error Handling