# 2q: molds and mold builders ### `++char` Char A single character. odor `@tD` designates a single unicode byte. All parsers consume `++tape`s, which are lists of `++char`. Source ------ ++ char @tD :: UTF-8 byte Examples -------- > *char '' ~zod/try> (char 97) 'a' *** ### `++cord` UTF-8 text One of Hoon's two string types (the other being `++tape`). A cord is an atom of UTF-8 text. `++trip` and `++crip` convert between cord and `++tape`. Source ------ ++ cord @t :: text atom (UTF-8) Examples -------- Odor `@t` designates a Unicode atom, little-endian: the first character in the text is the low byte. > `@ux`'foobar' 0x7261.626f.6f66 > `@`'urbit' 499.984.265.845 > (cord 499.984.265.845) 'urbit' *** ### `++date` Point in time A boolean designating AD or BC, a year atom, a month atom, and a `++tarp`, which is a day atom and a time. Source ------ ++ date {{a/? y/@ud} m/@ud t/tarp} :: parsed date Examples -------- See also: `++year`, `++yore` `++stud`, `++dust` > `date`(yore ~2014.6.6..21.09.15..0a16) [[a=%.y y=2.014] m=6 t=[d=6 h=21 m=9 s=15 f=~[0xa16]]] *** ### `++tang` ++ tang (list tank) :: general error Unused XX *** ### `++tank` Pretty-printing structure. A `++tank` is one of three cases: a `%leaf` is simply a string; a `%palm` is XX need more information; and a `%rose` is a list of `++tank` delimted by the strings in `p`. Source ------ ++ tank $% {$leaf p/tape} :: printing formats $: $palm :: backstep list p/{p/tape q/tape r/tape s/tape} :: q/(list tank) :: == :: $: $rose :: flat list p/{p/tape q/tape r/tape} :: mid open close q/(list tank) :: == :: == :: Examples -------- > >(bex 20) (bex 19)< [%rose p=[p=" " q="[" r="]"] q=~[[%leaf p="1.048.576"] [%leaf p="524.288"]]] > (wash [0 80] >(bex 20) (bex 19)<) :: at 80 cols <<"[1.048.576 524.288]">> > (wash [0 15] >(bex 20) (bex 19)<) :: at 15 cols (two lines) <<"[ 1.048.576" " 524.288" "]">> > [(bex 150) (bex 151)] :: at 80 cols [ 1.427.247.692.705.959.881.058.285.969.449.495.136.382.746.624 2.854.495.385.411.919.762.116.571.938.898.990.272.765.493.248 ] *** ### `++tape` List of chars One of Hoon's two string types, the other being `++cord`. A tape is a list of chars. Source ------ ++ tape (list char) :: like a string Examples -------- > `(list ,char)`"foobar" "foobar" > `(list ,@)`"foobar" ~[102 111 111 98 97 114] *** ### `++tarp` Day through second The remaining part of a `++date`: day, hour, minute, second and a list of `@ux` for precision. Source ------ ++ tarp {d/@ud h/@ud m/@ud s/@ud f/(list @ux)} :: parsed time Examples -------- > -<- ~2014.9.20..00.43.33..b52a > :: the time is always in your context at -<- > (yell -<-) [d=106.751.991.820.278 h=0 m=43 s=39 f=~[0x54d1]] > (yell ~d20) [d=20 h=0 m=0 s=0 f=~] *** ### `++term` Hoon constants A restricted text atom for Hoon constants. The only characters permitted are lowercase ASCII, `-`, and `0-9`, the latter two of which can neither be the first or last character. The syntax for `@tas` is the text itself, always preceded by `%`. This means a term is always cubical. The empty `@tas` has a special syntax, `$`. Source ------ ++ term @tas :: Hoon ASCII subset Examples -------- > *term %$ > %dead-fish9 %dead-fish9 > -:!>(%dead-fish9) [%cube p=271.101.667.197.767.630.546.276 q=[%atom p=%tas]] *** ### `++wain` ++ wain (list cord) :: text lines (no \n) A list of lines. A `++wain` is used instead of a single `++cord` with `\n`. See also: `++lore`, `++role` > `wain`/som/del/rok <|som del rok|> *** ### `++wall` List of lines A `++wall` is used instead of a single `++tape` with `\n`. Source ------ ++ wall (list tape) :: text lines (no \n) Examples -------- See also: `++wash` > `wall`(wash [0 20] leaf+<(bex 256)>) << "115.792.089.237.316.195.423.570.985.008.687.907.853.269.984.665.640.564.039.457.584.007.913.129.639.936" >> ***