on master help sign in
Merge pull request #1035 from urbit/auras-ref
81a2797poprox
hoon/reference/auras.md+28−7
@@ -8,13 +8,10 @@ Auras are system of nested "soft types" on [atoms](@/docs/glossary/atom.md) that
8are used to track metadata about how a particular atom is to be interpreted.
8are used to track metadata about how a particular atom is to be interpreted.
9This is used for type checking as well as pretty printing.
9This is used for type checking as well as pretty printing.
10
10
11−A given aura nests under any aura whose name is a substring of the given aura,
12−i.e. `@ux` nests under `@u`, and all auras nest under the empty aura `@`. We
13−call auras "soft types" since this nesting behavior can be ignored - see
14−[below](#non-coercive).
15−
16You can learn more about auras in [Hoon school](@/docs/hoon/hoon-school/atoms-auras-and-simple-cell-types.md).
11You can learn more about auras in [Hoon school](@/docs/hoon/hoon-school/atoms-auras-and-simple-cell-types.md).
17
12
13+### Table of Auras
14+
18```
15```
19Aura Meaning Example Literal Syntax
16Aura Meaning Example Literal Syntax
20-------------------------------------------------------------------------
17-------------------------------------------------------------------------
@@ -52,6 +49,8 @@ Aura Meaning Example Literal Syntax
52 @ux unsigned hexadecimal 0x5f5.e138
49 @ux unsigned hexadecimal 0x5f5.e138
53```
50```
54
51
52+### Bitwidth
53+
55Capital letters at the end of auras indicate the bitwidth in binary powers of
54Capital letters at the end of auras indicate the bitwidth in binary powers of
56two, starting from A.
55two, starting from A.
57
56
@@ -63,9 +62,22 @@ two, starting from A.
63 @uvJ unsigned, 512-bit integer (frequently used for entropy)
62 @uvJ unsigned, 512-bit integer (frequently used for entropy)
64```
63```
65
64
66−### Non-coercive
65+### Nesting
67
66
67+A given aura nests under any aura whose name is a substring or extension of the
68+given aura:
69+```
70+> :- (~(nest ut [%atom %ud ~]) | [%atom %u ~])
71+ (~(nest ut [%atom %ud ~]) | [%atom %udx ~])
72+[%.y %.y]
73+```
74+but does not nest "sideways":
75+```
76+> (~(nest ut [%atom %ud ~]) | [%atom %ux ~])
77+%.n
78+```
79+We call auras "soft types" since this nesting behavior can be ignored. Auras are
68−Auras are non-coercive, but conversions may have to go via the empty aura, e.g.
80+non-coercive, but conversions may have to go via the empty aura, e.g.
69```
81```
70> ^-(@ud ^-(@ 'foo'))
82> ^-(@ud ^-(@ 'foo'))
717.303.014
837.303.014
@@ -75,3 +87,12 @@ This is implicitly done by the irregular form of `^-`.
75> `@ud`'foo'
87> `@ud`'foo'
767.303.014
887.303.014
77```
89```
90+
91+### Bunting
92+
93+The bunt value for all auras is 0 except for `@da`.
94+```
95+> *@da
96+~2000.1.1
97+```
98+A bunt value of 0 is helpful when working with loobeans.