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