on master help sign in
json-guide: add note about foo+bar syntax
619a8a8Tinnus Napbus
content/docs/hoon/guides/json-guide.md+2
@@ -112,6 +112,8 @@ Let's have a look at a practical example. Here's a core with three arms. It has
112--
112--
113```
113```
114
114
115+**Note**: This example (and a couple of others in this guide) sometimes use a syntax of `foo+bar`. This is just syntactic sugar to tag the head of `bar` with the `term` constant `%foo`, and is equivalent to `[%foo bar]`. Since `json` data is a union with head tags of `%b`, `%n`, `%s`, `%a`, or `%o`, it's sometimes convenient to do `s+'some string'`, `b+&`, etc.
116+
115### Try it out
117### Try it out
116
118
117First we'll try using our `$json` encoding/decoding library, and afterwards we'll take a closer look at its construction. To begin, save the code above in `/lib/json-test.hoon` of the `%base` desk on a fake ship and `|commit` it:
119First we'll try using our `$json` encoding/decoding library, and afterwards we'll take a closer look at its construction. To begin, save the code above in `/lib/json-test.hoon` of the `%base` desk on a fake ship and `|commit` it: