From 65eef4fade5eb426dae01d480f383b8a30b23071 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 11 Aug 2021 14:06:02 -0400 Subject: Change "BQN / main" in header to "(github) / BQN" --- docs/doc/lexical.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/doc/lexical.html') diff --git a/docs/doc/lexical.html b/docs/doc/lexical.html index d65f269b..2ce2cfc9 100644 --- a/docs/doc/lexical.html +++ b/docs/doc/lexical.html @@ -3,7 +3,7 @@ BQN: Lexical scoping - +

Lexical scoping

BQN uses lexical scope, like most modern functional programming languages including Javascript, Scheme, and Julia, and like Dyalog APL's dfns (tradfns are dynamically scoped). This document describes how lexical scoping works, and a few small details relevant to BQN's version of it.

In short, every block is a separate scope that can refer to identifiers in containing scopes. When evaluated, the block makes a variable for each identifier defined in it (including arguments and operands). The blocks that it contains will now access these variables. In the first level of a block, variables must be defined before they can be used, but in child blocks, a variable can be used regardless of where it's defined, as long as the definition is evaluated before the child block is.

-- cgit v1.2.3