on master help sign in
Merge pull request #192 from urbit/ford-runes-fix
de4f62dKeaton Dunsford
docs/arvo/internals/ford/runes.md+42−1
@@ -12,14 +12,51 @@ The `/+` rune accepts a filename as an argument. It interprets that filename
12as a hoon source file within the `lib` directory. This is how we import a shared
12as a hoon source file within the `lib` directory. This is how we import a shared
13library in urbit.
13library in urbit.
14
14
15−Example:
15+To run this example, put this code in your desk at `gen/faslus.hoon` and run
16+`+faslus` in your dojo. This example is a generator. For more information on
17+generators, see the [generator docs](https://urbit.org/docs/arvo/generators).
18+
16```
19```
17/+ time-to-id
20/+ time-to-id
18::
21::
22+:- %say
23+|= {now/@da * *} $~ $~}
24+:- %noun
19(time-to-id now)
25(time-to-id now)
20```
26```
27+
21produces: `"c.314d"` (or something similar depending on when you run it)
28produces: `"c.314d"` (or something similar depending on when you run it)
22
29
30+You can import multiple libraries with a single `/+` rune by separating them
31+with commas.
32+
33+Replace the code in `gen/faslus.hoon` with the following:
34+
35+```
36+/+ time-to-id, hep-to-cab
37+::
38+:- %say
39+|= {{now/@da * *} $~ $~}
40+:- %noun
41+=/ id (time-to-id now)
42+=/ str "my-id-is-{id}"
43+(hep-to-cab (crip str))
44+```
45+
46+This should print something like `my_id_is_c.3588`.
47+
48+Another feature of the
49+`/+ and`/-`runes is the ability to specify the`ship`and`case\` from which to
50+load the library.
51+
52+Example:
53+
54+```
55+/+ time-to-id, hep-to-cab/4/~zod
56+```
57+
58+will load the `hep-to-cab` library from `~zod` at `%clay` revision `4`.
59+
23### `/-` import from sur/
60### `/-` import from sur/
24
61
25The `/-` rune accepts a filename as an argument. It interprets that filename as
62The `/-` rune accepts a filename as an argument. It interprets that filename as
@@ -35,6 +72,10 @@ Example:
35```
72```
36produces: `0v0`
73produces: `0v0`
37
74
75+`/-` can also take multiple files as arguments, and the ship and case of those
76+arguments can be specified. See the `/+` docs for more details about the syntax
77+for those features.
78+
38### `/~` twig by hand
79### `/~` twig by hand
39
80
40`/~ <twig>` produces a "horn" that evaluates a twig and places the product in
81`/~ <twig>` produces a "horn" that evaluates a twig and places the product in