4k: Atom Printing
+co
+coLiteral rendering engine.
+co contains three parts:
A door that contains arms that operate on the sample
$coin.lot.A core of rendering idioms.
A core of additional formatting functions used internally.
Accepts
.lot is a $coin.
Source
The arm begins with the door:
++ co
!:
~% %co ..co ~
=< |_ lot=coinThen after that the rendering idiom core begins with:
=| rep=tape
=< |%And finally the third core:
+rear:co
+rear:coPrepend & render as $tape.
Renders a $coin .lot as a $tape prepended to the sample $tape .rom.
Accepts
.lot is a $coin, and is the sample of +co.
.rom is a $tape.
Produces
A $tape.
Source
Examples
+rent:co
+rent:coRender as $knot.
Renders a $coin .lot as a $knot.
Accepts
.lot is a $coin, and is the sample of +co.
Produces
A $knot.
Source
Examples
+rend:co
+rend:coRender as $tape.
Renders a $coin .lot as a $tape.
Accepts
.lot is a $coin, and is the sample of +co.
Produces
A $tape.
Source
Examples
+a-co:co
+a-co:coRender decimal.
Render .dat as a decimal integer without separators.
Accepts
.dat is an $atom.
Produces
A $tape
Source
Examples
+c-co:co
+c-co:coRender base58check.
Renders the given $atom as a base58check $tape.
Accepts
An $atom.
Produces
A $tape.
Source
Examples
+d-co:co
+d-co:coRender decimal with min length.
Render .hol as a decimal integer without separators and with a minimum length of .min. If .hol has less than .min digits, leading zeros will be added to make up the difference.
Accepts
.min is an $atom.
.hol is an $atom.
Produces
A $tape.
Source
Examples
+r-co:co
+r-co:coRender floating point.
Render decimal float .a as a $tape.
Accepts
.a is a +dn.
Produces
A $tape.
Source
Examples
+s-co:co
+s-co:coRender hex list.
Render .esc, a list of $atoms, as hex with a dot before each value. Values less than two bytes in length will be padded with zeros.
Accepts
.esc is a (list @).
Produces
A $tape.
Source
Examples
+v-co:co
+v-co:coRender base-32 with minimum length.
Render .hol as base-32 with a minimum length of .min. If .hol is shorter than .min it will be padded with zeros.
Accepts
.min is a @ud.
.hol is an $atom.
Produces
A $tape.
Source
Examples
+w-co:co
+w-co:coRender base-64 with minimum length.
Render .hol as base-64 with a minimum length of .min. If .hol is horter than .min it will be padded with zeros.
Accepts
.min is a @ud.
.hol is an $atom.
Produces
A $tape.
Source
Examples
+x-co:co
+x-co:coRender hex with minimum length.
Render .hol as hex with a minimum length of .min. If .hol is horter than .min it will be padded with zeros.
Accepts
.min is a @ud.
.hol is an $atom.
Produces
A $tape.
Source
Examples
+y-co:co
+y-co:coRender decimal with at least two digits.
Render .dat as a decimal with a minimum of two digits. If .dat is less than two digits it will be padded with zeros.
Accepts
.dat is an $atom.
Produces
A $tape.
Source
Examples
+z-co:co
+z-co:coRender 0x-prefixed hex.
Render .dat as hex with a 0x prefix.
Accepts
.dat is an $atom.
Produces
A $tape.
Source
Examples
+em-co:co
+em-co:coRender in numeric base.
In base .bas, format .min digits of .hol with .par. This is used internally by other rendering functions.
.holis processed least-significant digit first.All available digits in
.holwill be processed, but.mindigits can exceed the number available in.hol.parhandles all accumulated output on each call, and can edit it, prepend or append digits, etc.Until
.holis exhausted,.par's sample is[| digit output], subsequently, it's[& 0 output].
Accepts
[bas=@ min=@], where .bas is the numeric base and .min is the minimum length.
.par is a $gate of $-([? @ tape] tape).
.hol is an $atom.
Produces
A $tape.
Source
Examples
+ed-co:co
+ed-co:coFormat with decimal place.
Format .int by specifying its size with .exp, which may be negative. This is used internally by other rendering functions.
Accepts
.exp is a @s.
.int is a $tape.
Produces
A $tape.
Source
Examples
+ox-co:co
+ox-co:coFormat dot-separated digits in numeric base.
In base .bas, format each digit of .hol with gate .dug, with '.' separators every .gop digits. This is used internally by other rendering functions.
.holis processed least-significant digit first..dughandles individual digits, output is prepended.Every segment but the last is zero-padded to
.gop.
Accepts
[bas=@ gop=@] where .bas is the numeric base and .gop is dot separator frequency.
.dug is a $gate of $-(@ @).
.hol is an $atom.
Produces
A $tape.
Source
Examples
+ro-co:co
+ro-co:coFormat dot-prefixed bloqs in numeric base.
In base .bas, for .buz bloqs 0 to .dop, format at least one digit of .hol, prefixed with .. This is used internally for @i address rendering functions.
Accepts
[buz=@ bas=@ dop=@] where .buz is the bloq size, .bas is the numeric base, and .dop is the number of bloqs.
.dug is a $gate of $-(@ @).
.hol is an $atom.
Produces
A $tape.
Source
Examples
Last updated