on master help sign in
revisions to sig runes
7b592dejoshuareagan
docs/reference/rune/sig/ban.udon+1−1
@@ -7,7 +7,7 @@
7
7
8# `~> "sigban"`
8# `~> "sigban"`
9
9
10−`[%sggr p=$@(term [p=term q=hoon]) q=hoon]`: raw hint, applied
10+`[%sgbn p=$@(term [p=term q=hoon]) q=hoon]`: raw hint, applied
11to computation.
11to computation.
12
12
13## Expands to
13## Expands to
docs/reference/rune/sig/bus.udon+1−1
@@ -7,7 +7,7 @@
7
7
8# `~$ "sigbus"`
8# `~$ "sigbus"`
9
9
10−`[%sgbc p=term q=hoon]`: profiling hit counter.
10+`[%sgbs p=term q=hoon]`: profiling hit counter.
11
11
12## Expands to
12## Expands to
13
13
docs/reference/rune/sig/cen.udon+3−3
@@ -25,7 +25,7 @@ between opening and closing `==`.
25
25
26## Discussion
26## Discussion
27
27
28−`~%` ("sigcen" is for registering cores. A registered core declares its
28+`~%` is for registering cores. A registered core declares its
29formal identity to the interpreter, which may or may not be able
29formal identity to the interpreter, which may or may not be able
30to recognize and/or accelerate it.
30to recognize and/or accelerate it.
31
31
@@ -50,7 +50,7 @@ general-purpose hotspot optimizer or "JIT"; or (c) merely a
50hotspot declaration for profiling.
50hotspot declaration for profiling.
51
51
52As always with hints, the programmer has no idea which of (a),
52As always with hints, the programmer has no idea which of (a),
53−(b), and (c) will be applied. She should use `~%`
53+(b), and (c) will be applied. Use `~%`
54indiscriminately on all hotspots, bottlenecks, etc, real or
54indiscriminately on all hotspots, bottlenecks, etc, real or
55suspected.
55suspected.
56
56
@@ -68,7 +68,7 @@ already registered.
68
68
69Registers a jet in core `s` so that it can be called when that code is run.
69Registers a jet in core `s` so that it can be called when that code is run.
70
70
71−Regularm form: *4-fixed*
71+Regular form: *4-fixed*
72
72
73## Examples
73## Examples
74
74
docs/reference/rune/sig/led.udon+4−4
@@ -5,9 +5,9 @@
5 ==
5 ==
6;>
6;>
7
7
8−# `~< "sigled"`
8+# `~< "sigled"`
9
9
10−`[%sggl p=$@(term [p=term q=hoon]) q=hoon]`: raw hint, applied to
10+`[%sgld p=$@(term [p=term q=hoon]) q=hoon]`: raw hint, applied to
11product.
11product.
12
12
13## Expands to
13## Expands to
@@ -20,8 +20,8 @@ Regular: *2-fixed*. For the dynamic form, write `%term.hoon`.
20
20
21## Discussion
21## Discussion
22
22
23−`~<` ("siggal") is only used for jet hints ([`~/` ("sigfas")](../fas/)
23+`~<` is only used for jet hints ([`~/`](../fas/)
24−and [`~%` ("sigcen")](../cen/)) at the moment; we are not telling the
24+and [`~%`](../cen/)) at the moment; we are not telling the
25interpreter something about the computation we're about to perform, but
25interpreter something about the computation we're about to perform, but
26rather about its product.
26rather about its product.
27
27
docs/reference/rune/sig/net.udon+1−1
@@ -7,7 +7,7 @@
7
7
8# `~/ "signet"`
8# `~/ "signet"`
9
9
10−`[%sgfs p=term q=hoon]`: jet registration for gate with
10+`[%sgnt p=term q=hoon]`: jet registration for gate with
11registered context.
11registered context.
12
12
13## Expands to
13## Expands to
docs/reference/rune/sig/pad.udon+9−3
@@ -7,15 +7,21 @@
7
7
8# `~& "sigpad"`
8# `~& "sigpad"`
9
9
10−`[%sgpm p=hoon q=hoon]`: debugging printf.
10+`[%sgpd p=hoon q=hoon]`: debugging printf.
11
11
12## Expands to
12## Expands to
13
13
14`q`.
14`q`.
15
15
16−## Convention
16+## Product
17
17
18−Prettyprints `p` on the console before computing `q`.
18+Pretty-prints `p` on the console before computing `q`.
19+
20+## Discussion
21+
22+This rune has no semantic effect beyond the Hoon expression `q`. It's used solely to create a side-effect: printing the value of `p` to the console.
23+
24+It's most useful for debugging programs.
19
25
20## Syntax
26## Syntax
21
27
docs/reference/rune/sig/tis.udon+8−7
@@ -19,19 +19,20 @@ If `p` equals `q`, produce `p` instead of `q`.
19
19
20## Discussion
20## Discussion
21
21
22−Duplicates are especially bad news in Hoon, because comparing them
22+Duplicate nouns are especially bad news in Hoon, because comparing them
23−takes O(n) time. Use `~=` ("sigtis") to kill them as they breed.
23+takes O(n) time. Use `~=` to avoid this inefficiency.
24
24
25## Examples
25## Examples
26
26
27−This code traverses a tree and replaces all instances of `42` with
27+This code traverses a tree and replaces all instances of `32` with
28−`420`:
28+`320`:
29
29
30```
30```
31~zod:dojo> =foo |= a=(tree)
31~zod:dojo> =foo |= a=(tree)
32− ?~(a ~ ~=(a [?:(=(n.a 42) 420 n.a) $(a l.a) $(a r.a)]))
32+ ?~(a ~ ~=(a [?:(=(n.a 32) 320 n.a) $(a l.a) $(a r.a)]))
33+
33−~zod:dojo> (foo 42 ~ ~)
34+~zod:dojo> (foo 32 ~ ~)
34−[420 ~ ~]
35+[320 ~ ~]
35```
36```
36
37
37Without `~=`, it would build a copy of a completely unchanged tree. Sad!
38Without `~=`, it would build a copy of a completely unchanged tree. Sad!