on master help sign in
revisions to sig runes
commit7b592de3aaede39013d2fd0df31805525fc575f5 authorjoshuareagan <joshuareagan@gmail.com> dateWed 10 Oct 2018, 15:04 (8 years ago) parent568abcd
7 files changed+27−20
docs/reference/rune/sig/ban.udon+1−1 docs/reference/rune/sig/bus.udon+1−1 docs/reference/rune/sig/cen.udon+3−3 docs/reference/rune/sig/led.udon+4−4 docs/reference/rune/sig/net.udon+1−1 docs/reference/rune/sig/pad.udon+9−3 docs/reference/rune/sig/tis.udon+8−7
docs/reference/rune/sig/ban.udon+1−1
@@ -7,7 +7,7 @@
77
88# `~> "sigban"`
99
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
1111to computation.
1212
1313## Expands to
docs/reference/rune/sig/bus.udon+1−1
@@ -7,7 +7,7 @@
77
88# `~$ "sigbus"`
99
10−`[%sgbc p=term q=hoon]`: profiling hit counter.
10+`[%sgbs p=term q=hoon]`: profiling hit counter.
1111
1212## Expands to
1313
docs/reference/rune/sig/cen.udon+3−3
@@ -25,7 +25,7 @@ between opening and closing `==`.
2525
2626## Discussion
2727
28−`~%` ("sigcen" is for registering cores. A registered core declares its
28+`~%` is for registering cores. A registered core declares its
2929formal identity to the interpreter, which may or may not be able
3030to recognize and/or accelerate it.
3131
@@ -50,7 +50,7 @@ general-purpose hotspot optimizer or "JIT"; or (c) merely a
5050hotspot declaration for profiling.
5151
5252As 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 `~%`
5454indiscriminately on all hotspots, bottlenecks, etc, real or
5555suspected.
5656
@@ -68,7 +68,7 @@ already registered.
6868
6969Registers a jet in core `s` so that it can be called when that code is run.
7070
71−Regularm form: *4-fixed*
71+Regular form: *4-fixed*
7272
7373## Examples
7474
docs/reference/rune/sig/led.udon+4−4
@@ -5,9 +5,9 @@
55 ==
66;>
77
8−# `~< "sigled"`
8+# `~< "sigled"`
99
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
1111product.
1212
1313## Expands to
@@ -20,8 +20,8 @@ Regular: *2-fixed*. For the dynamic form, write `%term.hoon`.
2020
2121## Discussion
2222
23−`~<` ("siggal") is only used for jet hints ([`~/` ("sigfas")](../fas/)
24−and [`~%` ("sigcen")](../cen/)) at the moment; we are not telling the
23+`~<` is only used for jet hints ([`~/`](../fas/)
24+and [`~%`](../cen/)) at the moment; we are not telling the
2525interpreter something about the computation we're about to perform, but
2626rather about its product.
2727
docs/reference/rune/sig/net.udon+1−1
@@ -7,7 +7,7 @@
77
88# `~/ "signet"`
99
10−`[%sgfs p=term q=hoon]`: jet registration for gate with
10+`[%sgnt p=term q=hoon]`: jet registration for gate with
1111registered context.
1212
1313## Expands to
docs/reference/rune/sig/pad.udon+9−3
@@ -7,15 +7,21 @@
77
88# `~& "sigpad"`
99
10−`[%sgpm p=hoon q=hoon]`: debugging printf.
10+`[%sgpd p=hoon q=hoon]`: debugging printf.
1111
1212## Expands to
1313
1414`q`.
1515
16−## Convention
16+## Product
1717
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.
1925
2026## Syntax
2127
docs/reference/rune/sig/tis.udon+8−7
@@ -19,19 +19,20 @@ If `p` equals `q`, produce `p` instead of `q`.
1919
2020## Discussion
2121
22−Duplicates are especially bad news in Hoon, because comparing them
23−takes O(n) time. Use `~=` ("sigtis") to kill them as they breed.
22+Duplicate nouns are especially bad news in Hoon, because comparing them
23+takes O(n) time. Use `~=` to avoid this inefficiency.
2424
2525## Examples
2626
27−This code traverses a tree and replaces all instances of `42` with
28−`420`:
27+This code traverses a tree and replaces all instances of `32` with
28+`320`:
2929
3030```
3131~zod:dojo> =foo |= a=(tree)
32− ?~(a ~ ~=(a [?:(=(n.a 42) 420 n.a) $(a l.a) $(a r.a)]))
33−~zod:dojo> (foo 42 ~ ~)
34−[420 ~ ~]
32+ ?~(a ~ ~=(a [?:(=(n.a 32) 320 n.a) $(a l.a) $(a r.a)]))
33+
34+~zod:dojo> (foo 32 ~ ~)
35+[320 ~ ~]
3536```
3637
3738Without `~=`, it would build a copy of a completely unchanged tree. Sad!