mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-21 05:41:43 +03:00
50 lines
758 B
Markdown
50 lines
758 B
Markdown
|
[bucket `$^` %bckt](#bckt)
|
||
|
==========================
|
||
|
|
||
|
Normalizing gate, `%herb`
|
||
|
|
||
|
`$^`, is a tile hoon that declares an [`%herb`](). An `%herb` is a gate,
|
||
|
accepting a sample of \* and normalizing it as you choose. If you use a
|
||
|
twig as a tile, it's treated as an herb.
|
||
|
|
||
|
Produces
|
||
|
--------
|
||
|
|
||
|
Tile: `[%herb p=twig]`
|
||
|
|
||
|
Sample
|
||
|
------
|
||
|
|
||
|
`p` is a [twig]().
|
||
|
|
||
|
Tall form
|
||
|
---------
|
||
|
|
||
|
$^ p
|
||
|
|
||
|
Wide form
|
||
|
---------
|
||
|
|
||
|
$^(p)
|
||
|
|
||
|
Irregular form
|
||
|
--------------
|
||
|
|
||
|
None
|
||
|
|
||
|
Examples
|
||
|
--------
|
||
|
|
||
|
~zod/try=> *$^(cord)
|
||
|
''
|
||
|
~zod/try=> *$^(|=(a=* ?^(a a [~ a])))
|
||
|
[~ 0]
|
||
|
~zod/try=> `$^(|=(a=* ?^(a a [~ a])))`1
|
||
|
! type-fail
|
||
|
! exit
|
||
|
~zod/try=> `$^(|=(a=* ?^(a a [~ a])))`[1 2]
|
||
|
[1 2]
|
||
|
~zod/try=> :type; *$^(|=(a=* ?^(a a [~ a])))
|
||
|
[~ 0]
|
||
|
{[%~ @] [* *]}
|