diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-06-14 22:13:43 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-06-18 16:38:12 -0400 |
| commit | 9b5c6783a95dc0a0048e93e6f610beaa20932191 (patch) | |
| tree | 4483c6c69cb5bdeceae1d4440c5d2107ac954883 /doc | |
| parent | fb0e65434f9e20a80a40ceb5088aea69404480f3 (diff) | |
Use [] instead of >⟨⟩ in a few places
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/arithmetic.md | 2 | ||||
| -rw-r--r-- | doc/arrayrepr.md | 2 | ||||
| -rw-r--r-- | doc/map.md | 2 | ||||
| -rw-r--r-- | doc/order.md | 6 | ||||
| -rw-r--r-- | doc/rank.md | 2 | ||||
| -rw-r--r-- | doc/types.md | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/doc/arithmetic.md b/doc/arithmetic.md index 86338bca..c3e17bf8 100644 --- a/doc/arithmetic.md +++ b/doc/arithmetic.md @@ -179,7 +179,7 @@ With two arguments many combinations are possible. Arrays of equal shape are mat Arrays with different ranks can also be paired: they are matched by [leading axis agreement](leading.md#leading-axis-agreement). This means that one shape must be a prefix of the other, and elements of the lower-rank array are repeated to match up with cells of the higher-rank one. - 1‿2‿3 ⋆ >⟨0‿1,2‿4,3‿6⟩ + 1‿2‿3 ⋆ [0‿1,2‿4,3‿6] This convention matches up with the way array nesting is handled: first, the leading "outer" axes are looped over, then later ones. diff --git a/doc/arrayrepr.md b/doc/arrayrepr.md index 9ea4aa57..e4f93948 100644 --- a/doc/arrayrepr.md +++ b/doc/arrayrepr.md @@ -153,6 +153,6 @@ BQN has literal notation for lists only right now. To get an array with rank oth ∘‿2 ⥊ ⟨2,3, 4,1, 0,5⟩ - > ⟨2‿3, 4‿1, 0‿5⟩ + [2‿3, 4‿1, 0‿5] The characters `[]` are reserved to potentially combine list notation with merging, allowing the above to be written `[2‿3, 4‿1, 0‿5]`. This would allow non-empty arrays with rank one or more to be written without a primitive, but not rank 0 or empty arrays. Since creating arrays in general would still require primitives like `<` or `⥊`, it's not clear whether this notation is worth it. General array notation is a surprisingly complicated topic; see the article about it [on the APL Wiki](https://aplwiki.com/wiki/Array_notation). @@ -154,7 +154,7 @@ If the argument lengths don't match then Each gives an error. This differs from Arguments can have any shape as long as the axis lengths match up. As with Table, the result elements don't depend on these shapes but the result shape does. - (>⟨20‿30‿10,50‿40‿60⟩) +⟜↕¨ 2‿1‿0≍3‿2‿1 + [20‿30‿10,50‿40‿60] +⟜↕¨ 2‿1‿0≍3‿2‿1 But arguments don't have to have exactly the same shape: just the same length along corresponding axes. These axes are matched up by [leading axis agreement](leading.md#leading-axis-agreement), so that one argument's shape has to be a prefix of the other's. With equal ranks, the shapes do have to match as we've seen above. diff --git a/doc/order.md b/doc/order.md index 3cd25b71..4adbc0f1 100644 --- a/doc/order.md +++ b/doc/order.md @@ -54,7 +54,7 @@ tp ← ⍉ tx ⋈⌜ y ((∾˜d)×((-∾+˜)pad)+sh∾dim) SVG g Ge ⟨ "rect" Elt rc ∾ sh Rp dim Paths ≍⟜(¯1↓y)¨(wv⊏tx)⋈¨tx - mg Ge (3⥊"String"⋈⊑ci) Gec tp Text¨ >⟨xt,wt,wv⊏xt⟩ + mg Ge (3⥊"String"⋈⊑ci) Gec tp Text¨ [xt,wt,wv⊏xt] ig Ge ("class="∾⊑ci) Ge (-⟜0‿0.33¨ Text¨ (FmtNum ↕≠xt)˙) ⊏tp cg Ge (¯0.8≍¨y) Text⟜Highlight¨ "𝕩"‿"⍋𝕩"‿"∧𝕩" ⟩ @@ -84,7 +84,7 @@ tp ← ⍉ tx ⋈⌜ y ((∾˜d)×((-∾+˜)pad)+sh∾dim) SVG g Ge ⟨ "rect" Elt rc ∾ sh Rp dim Paths (⋈¨⟜tx˘(≍⟜⍋wv)⊏tx) ≍¨⟜<˘ 2↕y - mg Ge ("String"<⊸∾ci) Gec tp Text¨ >⟨xt,wt,FmtNum⍋wv⟩ + mg Ge ("String"<⊸∾ci) Gec tp Text¨ [xt,wt,FmtNum⍋wv] ig Ge (3⥊ci) Gec (-⟜(⋈⟜0.33¨0.035×↕≠xt) Text¨ (FmtNum ↕≠xt)˙)˘ tp cg Ge (¯0.8≍¨y) Text⟜Highlight¨ "𝕩"‿"⍋𝕩"‿"⍋⍋𝕩" ⟩ @@ -105,7 +105,7 @@ The fact that Grade Up inverts a permutation is useful in itself. Note that this When sorting an array, we usually don't care how matching cells are ordered relative to each other (although as mentioned above it's possible to detect it by using fill elements carefully. They maintain their ordering). Grading is a different matter, because often the grade of one array is used to order another one. - ⊢ t ← >⟨ "dog"‿4, "ant"‿6, "pigeon"‿2, "pig"‿4 ⟩ + ⊢ t ← [ "dog"‿4, "ant"‿6, "pigeon"‿2, "pig"‿4 ] 1 ⊏˘ t diff --git a/doc/rank.md b/doc/rank.md index 7c1e2912..594156ce 100644 --- a/doc/rank.md +++ b/doc/rank.md @@ -170,7 +170,7 @@ The Rank modifier also accepts a list of one to three numbers for `𝕘`, as wel As an example, we'll define the matrix-vector product. A matrix is a rank-2 array and a vector is a list, and their product is a list. It's made up of the elements `+´ row × vec` for each row `row` of the matrix. To define this using Rank, we'll change `+´` to `+˝` to get a unit out, and we need to map over the rows of the left argument but not of the right one. Following the rules above, there are several ways to do this, including `+˝∘×⎉1`, `+˝∘×⎉¯1‿1`, and `+˝∘×⎉¯1‿∞`. Note that `⎉¯1` wouldn't work, because the ¯1 is interpreted separately for both arguments—it's equivalent to 1 matrix but 0 for the vector, or `⎉1‿0` overall. for the When correctly defined we can see that multiplication by the matrix `m` below negates the first element of a list, and also swaps it with the second. - ⊢ m ← >⟨0‿1‿0,¯1‿0‿0,0‿0‿1⟩ + ⊢ m ← [0‿1‿0, ¯1‿0‿0, 0‿0‿1] +˝ 0‿1‿0 × 1‿2‿3 diff --git a/doc/types.md b/doc/types.md index 0e1a97ca..dc246f26 100644 --- a/doc/types.md +++ b/doc/types.md @@ -35,7 +35,7 @@ Round ← { or← 0< v +´∘×⟜(⌽-⌾⊑)¨ 1⌽v "Z"∾˜ 'M'⌾⊑ ∾ ⥊ (('L'∾Fmt)¨ v+𝕩) ≍˘ or ('A'∾·Fmt(𝕨‿𝕨∾0‿0)∾∾)¨ (1⌽-v)+𝕩 } -a ← "path" Elt >⟨"d"‿(12 Round d1⊸ר ⥊ ((⊢≍˘1⊸⌽) 0‿2.6‿4) ≍¨ ↕3),¯1⊑cl⟩ +a ← "path" Elt ["d"‿(12 Round d1⊸ר ⥊ ((⊢≍˘1⊸⌽) 0‿2.6‿4) ≍¨ ↕3), ¯1⊑cl] FS ← {𝕩 Enc˜ "g"Attr⟨"font-size",(Fmt𝕨)∾"px"⟩} ((0‿2-p)∾dim) SVG ⟨ |
