most programming languages have awkward syntax for multiline strings.
you either get ugly indentation in your output, or ugly indentation in your code.
but in hoon, a “triple quote cord” strips indentation automatically based on where you put the quotes.
%^ cat :: conCATenate
3 :: cords
'''
name: foo bar (indent = 0)
meta:
tags: (indent = 2)
boop (indent = 4)
beep
date:
'''
(scot %da now.bowl)
notice that the opening and closing triple quotes are indented the same.
hoon uses that indentation as a baseline, and removes it from every line.
it's natural and tidy.
the code stays readable and foldable.
this design makes it easy to embed other languages or structured text directly in your code.
;div
;h1: hello world
;style
;- %- trip
'''
h1 { /* indent = 0 */
color: red; /* indent = 2 */
}
'''
==
==
this is just one of hoon's subtle joys.
and it combines well with the wonderful sail syntax.