From 7e0e38bd155fab76fa3b6776f9184611d044903d Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sun, 18 Jul 2021 17:53:37 -0400 Subject: Finish lexical scope documentation --- doc/embed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/embed.md') 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 -- cgit v1.2.3