aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/doc/types.html23
-rw-r--r--docs/style.css9
2 files changed, 32 insertions, 0 deletions
diff --git a/docs/doc/types.html b/docs/doc/types.html
index 373fc10f..c2ae74e5 100644
--- a/docs/doc/types.html
+++ b/docs/doc/types.html
@@ -15,6 +15,29 @@
<li>2-<a href="#modifiers">Modifier</a></li>
</ul>
<p>The first three types are called <em>data types</em>, and the rest are <em>operation types</em>. The array is the only <em>compound type</em>; the other types are <em>atomic types</em> and values of these types are called <em>atoms</em>. The fact that an array is only one type of many is common in modern programming languages but a novelty in the APL family. This decision is discussed in the page on <a href="based.html">based array theory</a>.</p>
+<svg viewBox='-64 -36 512 204'>
+ <g stroke-width='2'>
+ <path d='M0 12A12 12 0 0 1 12 0L244 0A12 12 0 0 1 256 12L256 52A12 12 0 0 0 268 64L372 64A12 12 0 0 1 384 76L384 116A12 12 0 0 1 372 128L12 128A12 12 0 0 1 0 116Z' class='yellow'/>
+ <rect width='368' height='48' x='8' y='8' rx='10px' class='purple'/>
+ <rect width='368' height='48' x='8' y='72' rx='10px' class='bluegreen'/>
+ </g>
+ <g text-anchor='middle' fill='currentColor'>
+ <g font-size='18px'>
+ <text x='64' y='32' dy='0.32em'>Number</text>
+ <text x='64' y='96' dy='0.32em'>Function</text>
+ <text x='192' y='32' dy='0.32em'>Character</text>
+ <text x='192' y='96' dy='0.32em'>1-modifier</text>
+ <text x='320' y='32' dy='0.32em'>Array</text>
+ <text x='320' y='96' dy='0.32em'>2-modifier</text>
+ </g>
+ <g font-size='16px'>
+ <text class='purple' x='96' y='-12.8' dy='0.32em'>Data</text>
+ <text class='bluegreen' x='96' y='140.8' dy='0.32em'>Operation</text>
+ <text class='yellow' x='281.6' y='147.2' dy='0.32em'>Atom</text>
+ </g>
+ </g>
+</svg>
+
<p>All of these types are immutable, meaning that a particular copy of a value will never change (to go further, with immutable types it doesn't really make sense to talk about a &quot;copy&quot; of a value: values just exist and nothing you do will affect them). The only form of mutability BQN has is the ability to change the value of a particular variable, that is, make the variable refer to a different value. Such a change can also change the behavior of a function or modifier that has the variable in its scope, and in this sense operation types are mutable—in fact it is possible to implement typical mutable data structures as functions that act on enclosed state.</p>
<p>It is likely that in the future <a href="extensions.html#namespaces-and-symbols">namespaces</a>, or references to enclosed scopes, will be added as a more directly manipulable mutable data type.</p>
<h2 id="data-types">Data types</h2>
diff --git a/docs/style.css b/docs/style.css
index 0a8727c9..1f1e9fa0 100644
--- a/docs/style.css
+++ b/docs/style.css
@@ -143,3 +143,12 @@ a:visited { color: #3d155f; }
a:link { color: #5592d9; text-decoration-color: #508dd978; }
a:visited { color: #8781c1; }
}
+
+.purple { fill:#d6afe0; stroke:#3d1b46; } text.purple { fill:#3b1346; stroke:none; }
+.bluegreen { fill:#55cbcb; stroke:#1c4e4e; } text.bluegreen { fill:#113939; stroke:none; }
+.yellow { fill:#e2d17f; stroke:#a28237; } text.yellow { fill:#7a5a0e; stroke:none; }
+@media (prefers-color-scheme: dark) {
+.purple { fill:#241922; stroke:#612d86; } text.purple { fill:#6e2ca0; stroke:none; }
+.bluegreen { fill:#0e2525; stroke:#297f7f; } text.bluegreen { fill:#578d8d; stroke:none; }
+.yellow { fill:#5b4b25; stroke:#a27e2a; } text.yellow { fill:#9d7925; stroke:none; }
+}