mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-19 21:02:01 +03:00
789 B
789 B
ketdot, ^.
, %ktdt
Cast to product type
^.
is a synthetic hoon that casts q
to the type of (p q)
. ^.
is
the same as casting q
to the product type of p
and comes in handy
when you don't want to run the contents of p
.
Produces
Twig: [%ktdt p=twig q=twig]
Sample
Tall form
^. p
q
Wide form
None
Irregular form
None
Examples
/~zod/try=> =cor |= [~ a=@]
[~ p=a]
changed %cor
/~zod/try=> ^.(cor [~ 97])
[~ p=97]
In this example we create a gate cor
that takes a cell of ~
and an
atom and produces [~ p=a]
. Using ^.
we can cast without calling
cor
and produce the same result.