From bb05186f2202c69bb0b5cf5375f3858da5151ab2 Mon Sep 17 00:00:00 2001 From: gnembon Date: Tue, 1 Feb 2022 01:56:30 +0100 Subject: [PATCH] docs --- docs/scarpet/api/Overview.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/scarpet/api/Overview.md b/docs/scarpet/api/Overview.md index a92da2af..e3ba6e6b 100644 --- a/docs/scarpet/api/Overview.md +++ b/docs/scarpet/api/Overview.md @@ -40,9 +40,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