diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-12-12 11:29:59 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-12-12 11:29:59 -0500 |
| commit | 4a6ad25256f4512573a87fe6f1a54fbabc86c2f6 (patch) | |
| tree | c7131019c36f3800d7f5ee0b60081d0d8d453fff /docs/doc/types.html | |
| parent | 27c5057cc5b09f29f0a5962f5ba837b217b5ecb0 (diff) | |
Some links to the section on mutability
Diffstat (limited to 'docs/doc/types.html')
| -rw-r--r-- | docs/doc/types.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/doc/types.html b/docs/doc/types.html index 075a0878..20ab9578 100644 --- a/docs/doc/types.html +++ b/docs/doc/types.html @@ -42,7 +42,7 @@ </g> </svg> -<p>The reason operations and namespaces are called "mutable" is that the values obtained from them—by calling an operation on particular arguments or reading a field from a namespace—may change over the course of the program. This property is caused by variable modification <code><span class='Gets'>↩</span></code>, which can directly change a namespace field, or change the behavior of an operation that uses the modified variable. This means that a program that doesn't include <code><span class='Gets'>↩</span></code> won't have such changes in behavior. However, there will still be an observable difference between immutable data and the mutable types: code that creates a mutable value (for example, a block function <code><span class='Brace'>{</span><span class='Value'>𝕩</span><span class='Brace'>}</span></code>) creates a different one each time, so that two different instances don't <a href="match.html">match</a> (<code><span class='Function'>≡</span></code>) each other. Data values created at different times may match, but mutable values never will.</p> +<p>The reason operations and namespaces are called "mutable" is that the values obtained from them—by calling an operation on particular arguments or reading a field from a namespace—<a href="lexical.html#mutation">may change</a> over the course of the program. This property is caused by variable modification <code><span class='Gets'>↩</span></code>, which can directly change a namespace field, or change the behavior of an operation that uses the modified variable. This means that a program that doesn't include <code><span class='Gets'>↩</span></code> won't have such changes in behavior. However, there will still be an observable difference between immutable data and the mutable types: code that creates a mutable value (for example, a block function <code><span class='Brace'>{</span><span class='Value'>𝕩</span><span class='Brace'>}</span></code>) creates a different one each time, so that two different instances don't <a href="match.html">match</a> (<code><span class='Function'>≡</span></code>) each other. Data values created at different times may match, but mutable values never will.</p> <p>An array is considered immutable because its shape, and what elements it contains, cannot change. An array has no identity outside these properties (and possibly its <a href="fill.html">fill element</a>), so an array with a different shape or different elements would simply be a different array. However, any element of an array could be mutable, in which case the behavior of the array would change with respect to the operation of selecting that element and calling it or accessing a field.</p> <h2 id="data-types"><a class="header" href="#data-types">Data types</a></h2> <p>Data types—numbers, characters, and arrays—are more like "things" than "actions". If called as a function, a value of one of these types simply returns itself. Data can be uniquely represented, compared for equality, and ordered using BQN's <a href="order.html#array-ordering">array ordering</a>; in contrast, determining whether two functions always return the same result can be undecidable. For arrays, these properties apply only if there are no operations inside. We might say that "data" in BQN refers to numbers, characters, and arrays of data.</p> |
