urbit/pub/docs/dev/hoon/runes/wt/wtpt.md
Galen Wolfe-Pauly bb495844be doc -> docs
2015-10-20 10:51:45 -07:00

654 B

wutpat, ?@, %wtpt

If atom

?@ is a synthetic rune that produces q if p is an atom, r otherwise.

Produces

Twig: [%wtpt p=wing q=twig r=twig]

Sample

p is a ++wing. q and r are twigs.

Tall form

Kingside:

?@  p
  q
r

Wide form

?@(p q r)

Irregular form

None

Examples

~zod/try=> ?@(~ 1 2)
! mint-vain
! exit
~zod/try=> ?@(%ha 1 2)
1
~zod/try=> ?@("" 1 2)
1
~zod/try=> ?@("a" 1 2)
2
~zod/try=> ?@([1 1] 1 2)
! mint-vain
! exit
~zod/try=> ?@(`*`[1 1] 1 2)
2