on master help sign in
Fixed 2h examples

Some examples here showed a different result than they would when tested in the Dojo

commit3613db67a1ddccc0839acf883b247ed0d4ddfffa authorrmariani <robert@tlon.io> dateFri 13 Jul 2018, 11:13 (8 years ago) parentbca25e5
1 file changed+22−21
docs/hoon/library/2h.md+22−21
docs/hoon/library/2h.md+22−21
@@ -137,6 +137,7 @@ A flag.
137137 %.y
138138
139139 > =a (sy [1 2 3 4 5 6 ~])
140+ > a
140141 [n=6 l={5 4} r={1 3 2}]
141142 > ~(apt in a)
142143 %.y
@@ -244,14 +245,14 @@ A set.
244245
245246 > =b (sy `(list @t)`['a' 'b' 'c' ~])
246247 > (~(del in b) 'a')
247− {'c' 'b'}
248+ [n='b' l=[n='c' l={} r={}] r=~]
248249
249250 > =b (sy `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
250251 > (~(del in b) 'john')
251− {'bonita' 'madeleine' 'daniel'}
252+ [n='madeleine' l=[n='daniel' l={} r={'bonita'}] r=~]
252253
253254 > (~(del in b) 'susan')
254− {'bonita' 'madeleine' 'daniel' 'john'}
255+ [n='madeleine' l=[n='daniel' l={} r={'bonita'}] r=[n='john' l={} r={}]]
255256
256257
257258***
@@ -293,16 +294,19 @@ A set.
293294
294295#### Examples
295296
296− > ((~(dif in (sy 1 2 3 ~)) (sy 2 3 4 ~))
297+
298+ > =c (sy 1 2 3 ~)
299+ > =d (sy 2 3 4 ~)
300+ > (~(dif in c) d)
297301 [n=1 l=~ r=~]
298302
299− > (~(dif in (sy 2 3 4 ~)) (sy 1 2 3 ~))
303+ > (~(dif in d) c)
300304 [n=4 l=~ r=~]
301305
302− > `(set @ud)`((~(dif in (sy 1 2 3 ~)) (sy 2 3 4 ~))
306+ > `(set @ud)`(~(dif in c) d)
303307 {1}
304308
305− > `(set @ud)`(~(dif in (sy 2 3 4 ~)) (sy 1 2 3 ~))
309+ > `(set @ud)`(~(dif in d) c)
306310 {4}
307311
308312***
@@ -338,21 +342,21 @@ The `unit` of an atom.
338342
339343#### Examples
340344
341− > =a (sy `(list @)`[1 2 3 4 5 6 7 ~])
342− > a
345+ > =a (sy `(list @)`[1 2 3 4 5 6 7 ~])
346+ > `(set @)`a
343347 {5 4 7 6 1 3 2}
344348
345349 > -.a
346350 n=6
347351
348352 > (~(dig in a) 7)
349− [~ 12]
353+ [~ u=12]
350354
351355 > (~(dig in a) 2)
352− [~ 14]
356+ [~ u=14]
353357
354358 > (~(dig in a) 6)
355− [~ 2]
359+ [~ u=2]
356360
357361#### Discussion
358362
@@ -388,17 +392,18 @@ A `set`.
388392
389393#### Examples
390394
395+ > =b `(set @t)`(sy `(list @t)`['bonita' 'madeleine' 'rudolf' 'john' ~])
391396 > b
392397 {'bonita' 'madeleine' 'rudolf' 'john'}
393398
394399 > (~(gas in b) `(list @t)`['14' 'things' 'number' '1.337' ~])
395− {'1.337' '14' 'number' 'things' 'bonita' 'madeleine' 'rudolf' 'john'}
400+ [n='number' l={'1.337' '14'} r={'things' 'bonita' 'madeleine' 'rudolf' 'john'}]
396401
397− > (~(gas in s) `(list ,@t)`['1' '2' '3' ~])
398− {'1' '3' '2' 'e' 'd' 'a' 'c' 'b'}
402+ > =s (sy `(list @t)`['a' 'b' 'c' 'd' 'e' ~])
403+ > (~(gas in s) `(list @t)`['1' '2' '3' ~])
404+ [n='e' l=[n='1' l={} r={'3' '2'}] r=[n='b' l={'d' 'a' 'c'} r={}]]
399405
400406***
401−
402407### `+-has:in`
403408
404409b in a?
@@ -490,9 +495,6 @@ A `set`.
490495 > (~(int in `(set @t)`(sy "ac")) `(set @t)`(sy "ha"))
491496 [n='a' l={} r={}]
492497
493− > (~(int in (sy "acmo")) (sy "lep"))
494− {}
495−
496498***
497499### `+-put:in`
498500
@@ -568,8 +570,6 @@ A noun.
568570 ?~ a +<+.b
569571 $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
570572
571−
572−
573573#### Examples
574574
575575 > =a (~(gas in *(set @)) [1 2 3 ~])
@@ -748,3 +748,4 @@ An atom.
748748
749749
750750***
751+