on master help sign in
Merge pull request #1083 from urbit/fix-style-whitespace

fix style guide whitespace

commit719fa26a220875cabe01c89435b3c415eff5d89c authorpoprox <51337059+drbeefsupreme@users.noreply.github.com> dateThu 26 Aug 2021, 16:38 (5 years ago) parent2e9bce2c817716
1 file changed+108−108
content/docs/hoon/reference/style.md+108−108
content/docs/hoon/reference/style.md+108−108
@@ -79,32 +79,32 @@ across the page.
7979With one child:
8080
8181```hoon
82− !:
83− a
82+!:
83+a
8484```
8585
8686With two:
8787
8888```hoon
89− =+ a
90− b
89+=+ a
90+b
9191```
9292
9393With three:
9494
9595```hoon
96− ?: a
97− b
98− c
96+?: a
97+ b
98+c
9999```
100100
101101With four (the maximum rune fanout):
102102
103103```hoon
104− :^ a
105− b
106− c
107− d
104+:^ a
105+ b
106+ c
107+d
108108```
109109
110110It is sometimes acceptable to not backstep -- especially in tuple
@@ -118,21 +118,21 @@ they can’t self-terminate. They are terminated by a `==` marker.
118118The sequence, or its variable part, is indented and vertical:
119119
120120```hoon
121− :* a
122− b
123− c
124− ==
121+:* a
122+ b
123+ c
124+==
125125```
126126
127127Another representation wastes a line, but saves an indent. Use
128128this only for very long sequences:
129129
130130```hoon
131− :*
132− a
133− b
134− c
135− ==
131+:*
132+ a
133+ b
134+ c
135+==
136136```
137137
138138Some variable sequences are sequences of pairs; some of these
@@ -143,29 +143,29 @@ looks better for this particular code.
143143Kingside format:
144144
145145```hoon
146− ?+ x default
147− %foo 99
148− %foobar ?: y
149− 42
150− (add 2 2)
151− 37 36
152− ==
146+?+ x default
147+ %foo 99
148+ %foobar ?: y
149+ 42
150+ (add 2 2)
151+ 37 36
152+==
153153```
154154
155155Queenside format:
156156
157157```hoon
158− ?+ x
159− default
160− ::
161− %foo
162− 99
163− ::
164− %foobar
165− ?: y
166− 42
167− (add 2 2)
168− ==
158+?+ x
159+ default
160+::
161+ %foo
162+ 99
163+::
164+ %foobar
165+ ?: y
166+ 42
167+ (add 2 2)
168+==
169169```
170170
171171The queenside format is more useful when the tails are bigger.
@@ -176,13 +176,13 @@ We sometimes end up with multiple terminators on separate lines,
176176two or more spaces apart. These lines can be collapsed:
177177
178178```hoon
179− ?+ x default
180− %foo 99
181− 37 36
182− %foobar ?- y
183− %moo 9
184− %bar 10
185− == ==
179+?+ x default
180+ %foo 99
181+ 37 36
182+ %foobar ?- y
183+ %moo 9
184+ %bar 10
185+== ==
186186```
187187
188188## General naming style
@@ -220,25 +220,25 @@ Hoon suggests “breathing comments.” There should always be an
220220empty comment line between a comment and the line **below** it:
221221
222222```hoon
223− :: look, code
224− ::
225− this.is.code
226− :: we are going to need more code
227− ::
228− this.is.more.code
223+:: look, code
224+::
225+this.is.code
226+:: we are going to need more code
227+::
228+this.is.more.code
229229```
230230
231231Sometimes dense code does need air on both sides. Also
232232legitimate:
233233
234234```hoon
235− :: look, code
236− ::
237− this.is.code
238− ::
239− :: we are going to need more code
240− ::
241− this.is.more.code
235+:: look, code
236+::
237+this.is.code
238+::
239+:: we are going to need more code
240+::
241+this.is.more.code
242242```
243243
244244But air on both sides is needed less often than you may think.
@@ -257,15 +257,15 @@ In older code you’ll also see attempts to produce large, visually
257257salient geometries as separators, like:
258258
259259```
260− ::
261− ::::
262− ::
260+::
261+::::
262+::
263263```
264264
265265or
266266
267267```
268− ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
268+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
269269```
270270
271271Please don’t do this in new code. Normal conventions should be
@@ -300,14 +300,14 @@ then an udon body with paragraphs broken by empty lines, indented
300300four spaces, in ASCII mixed case:
301301
302302```hoon
303− :: $foo: the definition of a foo
304− ::
305− :: The source of the word “foo” is lost in history. Some
306− :: think it comes from the WWII military term “FUBAR,”
307− :: in which “UBAR” stands for “up beyond all retrieval.”
308− ::
309− :: Somehow “FUBAR” became “foobar.” The rest is history.
310− ::
303+:: $foo: the definition of a foo
304+::
305+:: The source of the word “foo” is lost in history. Some
306+:: think it comes from the WWII military term “FUBAR,”
307+:: in which “UBAR” stands for “up beyond all retrieval.”
308+::
309+:: Somehow “FUBAR” became “foobar.” The rest is history.
310+::
311311```
312312
313313The point is: sometimes we want to see a deep explanation;
@@ -321,9 +321,9 @@ A feature headline is `::`, then two spaces, then a qualified
321321location, then `:`, then a freeform string. Like:
322322
323323```hoon
324− :: $foo: a the definition of a foo
325− ::
326− +$ foo [head=@ tail=^]
324+:: $foo: a the definition of a foo
325+::
326++$ foo [head=@ tail=^]
327327```
328328
329329We find the feature `$foo` relative to the current location and
@@ -337,9 +337,9 @@ Product comments describe the product of the expression below.
337337The headline is a string in parentheses:
338338
339339```hoon
340− :: (a very strange $foo indeed)
341− ::
342− make:a:strange:foo
340+:: (a very strange $foo indeed)
341+::
342+make:a:strange:foo
343343```
344344
345345### Flow comments and legends
@@ -364,15 +364,15 @@ make it … `[%wtcl if=hoon then=hoon else=hoon]`. Then we
364364could write flow comments as follows:
365365
366366```hoon
367− ?: :: if, it is winter
368− ::
369− is-winter
370− :: then, why not rome?
371− ::
372− visit-italy
373− :: else, amsterdam is nice in the summer
367+?: :: if, it is winter
374368 ::
375− visit-holland
369+ is-winter
370+ :: then, why not rome?
371+ ::
372+ visit-italy
373+:: else, amsterdam is nice in the summer
374+::
375+visit-holland
376376```
377377
378378The headline of a flow comment uses a **legend**: the name of
@@ -392,35 +392,35 @@ Sometimes, just for cosmetic reasons, we like to raise the
392392comment on the first leg of a rune up above the parent:
393393
394394```hoon
395− :: if, it is winter
396− ::
397− ?: is-winter
398− :: then, why not rome?
399− ::
400− visit-italy
401− :: else, amsterdam is nice in the summer
402− ::
403− visit-holland
395+:: if, it is winter
396+::
397+?: is-winter
398+ :: then, why not rome?
399+ ::
400+ visit-italy
401+:: else, amsterdam is nice in the summer
402+::
403+visit-holland
404404```
405405
406406This can make flow comments collide, as in “else, if,” below:
407407
408408```hoon
409− :: if, it is winter
410− ::
411− ?: is-winter
412− :: then, why not rome?
413− ::
414− visit-italy
415− :: else, if, sprechen sie deutsch?
416− ::
417− ?: speak-german
418− :: then, maybe berlin?
419− ::
420− visit-berlin
421− :: else, everyone in amsterdam speaks english
422− ::
423− visit-holland
409+:: if, it is winter
410+::
411+?: is-winter
412+ :: then, why not rome?
413+ ::
414+ visit-italy
415+:: else, if, sprechen sie deutsch?
416+::
417+?: speak-german
418+ :: then, maybe berlin?
419+ ::
420+ visit-berlin
421+:: else, everyone in amsterdam speaks english
422+::
423+visit-holland
424424```
425425
426426#### Flow comments, traces, and interpolation