diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-07-18 17:53:37 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-07-18 17:53:37 -0400 |
| commit | 7e0e38bd155fab76fa3b6776f9184611d044903d (patch) | |
| tree | 9cbd13e8aae249cb97b1dd2b22a084817093890c /doc/embed.md | |
| parent | bbecd676b7c127fead3ef172bbae3ddf2fb7f19a (diff) | |
Finish lexical scope documentation
Diffstat (limited to 'doc/embed.md')
| -rw-r--r-- | doc/embed.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/embed.md b/doc/embed.md index 32f14536..f98b6fdd 100644 --- a/doc/embed.md +++ b/doc/embed.md @@ -14,7 +14,7 @@ Instead, return a function from BQN and call it: `bqn("{รยด1+โ๐ฉ}")(n)`. Th BQN can also call JS functions, to use functionality that isn't native to BQN or interact with a program written in JS. For example, `bqn("{๐'a'+โ26}")(alert)` calls the argument `alert` from within BQN. The displayed output isn't quite right here, because a BQN string is stored as a JS array, not a string. See the next section for more information. -Cool, but none of these examples really use closures, just self-contained functions. Closures are functions that use outside state, which is maintained over the course of the program. Here's an example program that defines `i` and then returns a function that manipulates `i` and returns its new value. +Cool, but none of these examples really use closures, just self-contained functions. [Closures](lexical.md#closures) are functions that use outside state, which is maintained over the course of the program. Here's an example program that defines `i` and then returns a function that manipulates `i` and returns its new value. let push = bqn(` iโ4โฅ0 |
