on master help sign in
add /, docs; minor fix to earlier docs
9d57a53Ted Blackman
docs/arvo/internals/ford/runes.md+20−1
@@ -129,6 +129,8 @@ Example:
129goo
129goo
130```
130```
131
131
132+produces: `2`
133+
132Here's a slightly more complex example with runes that use the filesystem:
134Here's a slightly more complex example with runes that use the filesystem:
133```
135```
134/= file-length
136/= file-length
@@ -139,4 +141,21 @@ file-length
139```
141```
140produces the number of bytes in the file "/path/to/hoon/file."
142produces the number of bytes in the file "/path/to/hoon/file."
141
143
144+### `/,` switch by path
145+
146+`/,` is a switch statement, which picks a branch to evaluate based on
147+whether the current path matches the path in the switch statement.
148+
149+Example:
150+```
151+/= just-right
152+ /: /right-path :: set path to /right-path
153+ /,
154+ /wrong-path /~ ~
155+ /another-wrong-path /~ ~
156+ /right-path /~ %evaluate-me :: only evaluate this horn
157+ ==
158+`@t`just-right
159+```
160+
142−produces: `2`
161+produces: `'evaluate-me'`