diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-02-26 22:25:35 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-02-26 22:25:38 -0500 |
| commit | dc1c5fc3acfc6e381220be73162e6e41abb76e19 (patch) | |
| tree | 2ee4c0101daaeb1137a86eab9f9656a8f6ee91f2 /docs/commentary/problems.html | |
| parent | 4854a698fb966b3a9581a99234e73df7816f2b16 (diff) | |
Mention that tacit exports weaken encapsulation
Diffstat (limited to 'docs/commentary/problems.html')
| -rw-r--r-- | docs/commentary/problems.html | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/docs/commentary/problems.html b/docs/commentary/problems.html index acb0839b..fc90bc3f 100644 --- a/docs/commentary/problems.html +++ b/docs/commentary/problems.html @@ -137,6 +137,8 @@ <p>Select chooses whether the left argument maps to right argument axes or selects from the first axis only based on its depth. Without prototypes an empty array has depth 1, so it selects no major cells. However, it could also select from no axes (a no-op) and in some contexts the other behavior would be surprising.</p> <h3 id="unclear-primitive-names">Unclear primitive names</h3> <p>Blanket issue for names that I don't find informative: "Solo", "Bins", "Find", and "Group".</p> +<h3 id="tacit-exports-can-leak-data">Tacit exports can leak data</h3> +<p>One of the nice facets of BQN's module system is that it provides perfect encapsulation: if you have variables <code><span class='Value'>a</span></code> and <code><span class='Value'>b</span></code> in a namespace (or closure) initialized so that <code><span class='Value'>a</span><span class='Function'>≤</span><span class='Value'>b</span></code>, and all exported operations maintain the property that <code><span class='Value'>a</span><span class='Function'>≤</span><span class='Value'>b</span></code>, then that property will always be true. Well, not quite: if you define, say <code><span class='Function'>Inc</span> <span class='Gets'>⇐</span> <span class='Function'>IncA</span> <span class='Function'>⊣</span> <span class='Function'>IncB</span></code> to increase the values of both <code><span class='Value'>a</span></code> and <code><span class='Value'>b</span></code> by <code><span class='Value'>𝕩</span></code>, then <code><span class='Function'>Inc</span></code> maintains <code><span class='Value'>a</span><span class='Function'>≤</span><span class='Value'>b</span></code>, but <code><span class='Function'>IncA</span></code> doesn't—and it can be extracted with <code><span class='Function'>•Decompose</span></code>. This isn't too serious because it sounds impossible to do accidentally, and it's easy to protect against.</p> <h3 id="strands-go-left-to-right">Strands go left to right</h3> <p>This is the best ordering, since it's consistent with <code><span class='Bracket'>⟨</span><span class='Separator'>⋄</span><span class='Bracket'>⟩</span></code> lists. And code in a strand probably shouldn't have side effects anyway. Still, it's an odd little tack-on to say separators <em>and strands</em> go left to right, and it complicates the implementation a little.</p> <h3 id="primitive-name-capitalization">Primitive name capitalization</h3> |
