Hoon is all about lists, Here are a few examples I have saved for my own personal reference.
|= [input=tape]
=/ counter 0
=/ results *(list @t)
|-
?: =(counter (lent input))
results
=/ ascii `@t`(snag counter input)
%= $
counter (add counter 1)
results (snoc results ascii)
?: =(counter (lent input))
get the length of a input
and compare to counter
=/ ascii @t(snag counter input)
using snag
pick the counter
letter of input
. the @t
casts this value to a cord
(utf-8 text);
%= $
counter (add counter 1)
results (snoc results ascii)
==
using %= $
set multiple values (counter
and results
). snoc
concats ascii
to results
. Both must be the same type list @t