From fa8d2b75d05c5f061b76d86e776235e18a20213a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 2 Feb 2022 19:30:37 +0000 Subject: [PATCH] Merge docs for 'Carpet Mod 1.4.60 for Minecraft 22w05a' --- docs/scarpet/Full.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/scarpet/Full.md b/docs/scarpet/Full.md index 917ce1ec..1df069c1 100644 --- a/docs/scarpet/Full.md +++ b/docs/scarpet/Full.md @@ -1980,9 +1980,13 @@ apps `__on_close()` will execute once per app, and with `'player'` scoped apps, ### App config via `__config()` function If an app defines `__config` method, and that method returns a map, it will be used to apply custom settings -for this app. Currently the following options are supported: +for this app. Currently, the following options are supported: -* `'scope'`: default scope for global variables for the app, Default is `'player'`, which means that globals and defined +* `'strict'` : if `true`, any use of an uninitialized variable will result in program failure. Defaults to `false` if +not specified. With `'strict'`you have to assign an initial value to any variable before using it. It is very useful +to use this setting for app debugging and for beginner programmers. Explicit initialization is not required for your +code to work, but mistakes may result from improper assumptions about initial variable values of `null`. +* `'scope'`: default scope for global variables for the app, Default is `'player'`, which means that globals and defined functions will be unique for each player so that apps for each player will run in isolation. This is useful in tool-like applications, where behaviour of things is always from a player's perspective. With player scope the initial run of the app creates is initial state: defined functions, global variables, config and event handlers, which is then copied for