aboutsummaryrefslogtreecommitdiff
path: root/docs/doc/context.html
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2022-06-29 22:38:29 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2022-06-29 22:39:07 -0400
commit47c0a52e614d01eb251da9301c2961338141ab6c (patch)
treed0ac94596d81b2680b09fb7abc924fec1ca10a50 /docs/doc/context.html
parenta18eadf8df214b52ebb90c9bbbc433a3ad7c6ced (diff)
Editing continues, with some deletions this time
Diffstat (limited to 'docs/doc/context.html')
-rw-r--r--docs/doc/context.html5
1 files changed, 1 insertions, 4 deletions
diff --git a/docs/doc/context.html b/docs/doc/context.html
index 23422fac..6a093c43 100644
--- a/docs/doc/context.html
+++ b/docs/doc/context.html
@@ -55,10 +55,7 @@
</tr>
</tbody>
</table>
-<p>Unlike variables, BQN primitives have only one spelling, and a fixed role (but their values can be used in a different role by storing them in variables). Superscript glyphs <code><span class='Modifier'>˙˜˘¨⌜⁼´˝`</span></code> are used for 1-modifiers, and glyphs <code><span class='Modifier2'>∘○⊸⟜⌾⊘◶⎉⚇⍟⎊</span></code> with an unbroken circle are 2-modifiers. Other primitives are functions. String and numeric literals are subjects.</p>
-<p>BQN's variables use another system, where the spelling indicates how the variable's value is used. A variable spelled with a lowercase first letter, like <code><span class='Value'>var</span></code>, is a subject. Spelled with an uppercase first letter, like <code><span class='Function'>Var</span></code>, it is a function. Underscores are placed where operands apply to indicate a 1-modifier <code><span class='Modifier'>_var</span></code> or 2-modifier <code><span class='Modifier2'>_var_</span></code>. Other than the first letter or underscore, variables are case-insensitive.</p>
-<p>The associations between spelling and syntactic role are considered part of BQN's <a href="../spec/token.html">token formation rules</a>.</p>
-<p>One rule for typing is also best considered to be a pre-parsing rule like the spelling system: the role of a headerless <a href="block.html">block</a> <code><span class='Brace'>{}</span></code> is determined by which special arguments it uses: it's a subject if there aren't any, but a <code><span class='Value'>𝕨</span></code> or <code><span class='Value'>𝕩</span></code> makes it at least a function, an <code><span class='Function'>𝔽</span></code> makes it a 1- or 2-modifier, and a <code><span class='Function'>𝔾</span></code> always makes it a 2-modifier.</p>
+<p>BQN uses <a href="expression.html#role-spellings">a few rules</a> to determine what role various parts of the grammar have. Primitive glyphs follow patterns: 1-modifiers like <code><span class='Modifier'>˝</span></code> are superscripts and 2-modifiers like <code><span class='Modifier2'>○</span></code> use circles. A variable can be spelled with different casing or underscores to indicate the role each time it's used.</p>
<p>The syntactic role is a property of an expression, and BQN's grammar determines how roles interact in expressions. But <a href="types.html">type</a> is a property of a value, and evaluation rules control what types can be used. This means that roles exist statically in the code (context-free grammar!) while values can change between or within runs of the program. This is necessary to have a context-free grammar with unrestricted dynamic types. Are unrestricted dynamic types useful? Read on…</p>
<h2 id="mixing-roles"><a class="header" href="#mixing-roles">Mixing roles</a></h2>
<p>BQN's value types align closely with its syntactic roles: functions, 1-modifiers, and 2-modifiers are all types (<em>operation</em> types) as well as roles, while the other types (<em>data</em> types) are split into numbers, characters, and arrays. This is no accident, and usually values will be used in roles that correspond to their underlying type. However, the ability to use a role that doesn't match the type is also useful.</p>