From 441db9fd212a8770008807641b6bc43f1ce431e6 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sat, 7 May 2022 07:41:21 -0400 Subject: Correct Switch definition (fixes #66) --- doc/control.md | 4 ++-- docs/doc/control.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/control.md b/doc/control.md index b7e58436..fe2e77e9 100644 --- a/doc/control.md +++ b/doc/control.md @@ -19,7 +19,7 @@ The useful control structures introduced here are collected as shortened definit # Switch/case statements have many variations; these are a few Match ← {𝕏𝕨}Β΄ Select ← {(βŠ‘π•©)β—Ά(1↓𝕩)@} - Switch ← {cβ†βŠ‘π•© β‹„ mβ€Ώa←<Λ˜β‰βˆ˜β€Ώ2β₯Š1↓𝕩 β‹„ (βŠ‘a⊐C)β—Άm@} + Switch ← {cβ†βŠ‘π•© β‹„ mβ€Ώa←<Λ˜β‰βˆ˜β€Ώ2β₯Š1↓𝕩 β‹„ (m⊸⊐⌾# Switch/case statements have many variations; these are a few Match ← {𝕏𝕨}Β΄ Select ← {(βŠ‘π•©)β—Ά(1↓𝕩)@} -Switch ← {cβ†βŠ‘π•© β‹„ mβ€Ώa←<Λ˜β‰βˆ˜β€Ώ2β₯Š1↓𝕩 β‹„ (βŠ‘a⊐C)β—Άm@} +Switch ← {cβ†βŠ‘π•© β‹„ mβ€Ώa←<Λ˜β‰βˆ˜β€Ώ2β₯Š1↓𝕩 β‹„ (m⊸⊐⌾<C)β—Άa@} Test ← {fn←{Cβ€ΏAπ•Še:Cβ—ΆAβ€ΏE}´𝕩⋄Fn@}

Blocks and functions

@@ -126,7 +126,7 @@ }

To test against other possible values, the following statement takes interleaved lists of values and actions, and disentangles them. It searches through the values with ⊐.

-
Switch ← {cβ†βŠ‘π•© β‹„ mβ€Ώa←<Λ˜β‰βˆ˜β€Ώ2β₯Š1↓𝕩 β‹„ (βŠ‘a⊐C)β—Άm@}
+
Switch ← {cβ†βŠ‘π•© β‹„ mβ€Ώa←<Λ˜β‰βˆ˜β€Ώ2β₯Š1↓𝕩 β‹„ (m⊸⊐⌾<C)β—Άa@}
 
 Switch ⟨value
   "increment" β‹„ {𝕀⋄ v+↩1}
-- 
cgit v1.2.3