+iu: info utilities

a utility door for axals of dimes.

the source code lives in /lib/hawk/hoon


the following examples are assuming the subject:

in a hawk file, this door will be bound to the card under the face c.

=/  c  ~(. iu the-card)

where the-card looks something like:

/tas/'add-todo'
/donef/.y
/whenda/~2024.11.5
/namet/'buy groceries'

reb

top

unit attribute lookup

(reb:c)
returns
[~ [p=~.tas q=8.026.662.980.649.509.985]]
(reb:c /name)
returns
[~ [p=~.t q=9.142.624.152.563.479.481.165.742.175.586]]
(reb:c /not/in/info)
returns
~

rib

top

attribute lookup, or bunted dime

(rib:c)
returns
[p=~.tas q=8.026.662.980.649.509.985]
(rib:c /name)
returns
[p=~.t q=9.142.624.152.563.479.481.165.742.175.586]
(rib:c /not/in/info)
returns
[p=~. q=0]

rob

top

attribute lookup, or crash

(rob:c)
returns
[p=~.tas q=8.026.662.980.649.509.985]
(rob:c /name)
returns
[p=~.t q=9.142.624.152.563.479.481.165.742.175.586]
(rob:c /not/in/info)
returns
crash

rub

top

attribute lookup, or fallback

(rub:c /name tas/%fallback)
returns
[p=~.t q=9.142.624.152.563.479.481.165.742.175.586]
(rub:c /not/in/info tas/%fallback)
returns
[p=~.tas q=7.738.135.660.106.375.526]

peb

top

unitized attribute print

(peb:c)
returns
[~ "add-todo"]
(peb:c /name)
returns
[~ "buy groceries"]
(peb:c /not/in/info)
returns
~

pib

top

attribute print, with bunted dime

(pib:c)
returns
"add-todo"
(pib:c /name)
returns
"buy groceries"
(pib:c /not/in/info)
returns
"0x0"

pob

top

attribute print, or crash

(pob:c)
returns
"add-todo"
(pob:c /name)
returns
"buy groceries"
(pob:c /not/in/info)
returns
crash

pub

top

attribute print, with fallback

(pub:c /name tas/%fallback)
returns
"buy groceries"
(pub:c /not/in/info tas/%fallback)
returns
"fallback"

peb-as

top

unitzed attribute explicit print

(peb-as:c %ta /)
returns
[~ "~.add-todo"]
(peb-as:c %ta /name)
returns
[~ "~.buy groceries"]
(peb-as:c %ta /not/in/info)
returns
~

pib-as

top

attribute explicit print, with bunted dime

(pib-as:c %ta /)
returns
"~.add-todo"
(pib-as:c %ta /name)
returns
"~.buy groceries"
(pib-as:c %ta /not/in/info)
returns
"~."

pob-as

top

attribute explicit print, or crash

(pob-as:c %ta /)
returns
"~.add-todo"
(pob-as:c %ta /name)
returns
"~.buy groceries"
(pob-as:c %ta /not/in/info)
returns
crash

pub-as

top

attribute explicit print, with fallback

(pub-as:c %ta /name tas/%fallback)
returns
"~.buy groceries"
(pub-as:c %ta /not/in/info tas/%fallback)
returns
"~.fallback"