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 --- docs/doc/oop.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/doc/oop.html') diff --git a/docs/doc/oop.html b/docs/doc/oop.html index 6a0c339d..59a6c851 100644 --- a/docs/doc/oop.html +++ b/docs/doc/oop.html @@ -152,7 +152,7 @@

This is a pretty clunky solution, and exports a useless method SetThis (which gives an error if it's ever called). It would be possible for BQN to define a system value •this that just gets the namespace's value. It would work only at the top level, so it would have to be assigned (this•this) in order to use it in functions. This means it's always used before the namespace is done being defined, so a drawback is that it introduces the possibility that an object used in a program has undefined fields. The reason this isn't possible for objects without •this is that BQN's blocks don't have any sort of control flow, so that they always execute every statement in order. The namespace becomes accessible as a value once the block finishes, and at this point every statement has been executed and every field is initialized.

Class members

-

As with this, giving a class variables that belong to it is a do-it-yourself sort of thing (or more positively, not at all magic (funny how programmer jargon goes the opposite way to ordinary English)). It's an easy one though, as this is exactly what lexical scoping does:

+

As with this, giving a class variables that belong to it is a do-it-yourself sort of thing (or more positively, not at all magic (funny how programmer jargon goes the opposite way to ordinary English)). It's an easy one though, as this is exactly what lexical scoping does:

staticClass  {
   counter  0
   {𝕤
-- 
cgit v1.2.3