(.require
 [library
  [lux (.except)
   ["$" documentation]
   [data
    [text (.only \n)
     ["%" \\format (.only format)]]
    [collection
     ["[0]" list]]]]]
 [\\library
  ["[0]" /]])

(def .public documentation
  (List $.Documentation)
  (list ($.module /._
                  "Utilities commonly used while templating.")

        ($.definition /.irregular_arguments)

        ($.definition /.spliced
          ""
          [(spliced [a b c d])
           "=>"
           a
           b
           c
           d])

        ($.definition /.amount
          ""
          [(amount [a b c d])
           "=>"
           4])

        ($.definition /.with_locals
          "Creates names for local bindings aliased by the names you choose."
          [(with_locals [my_var]
             (let [my_var 123]
               (text [my_var])))
           "=>"
           "__gensym__my_var506"])

        ($.definition /.text
          "A text literal made by concatenating pieces of code."
          [(text [#0 123 +456 +789.0 "abc" .def ..ghi])
           "=>"
           "#0123+456+789.0abcdefghi"])

        ($.definition /.symbol
          (format "An symbol made by concatenating pieces of code."
                  \n "The (optional) module part and the short part are specified independently.")
          [(symbol ["abc" .def ..ghi])
           "=>"
           abcdefghi]
          [(symbol [.def] ["abc" .def ..ghi])
           "=>"
           .abcdefghi])

        ($.definition /.let
          "Lexically-bound templates."
          [(let [(!square <root>)
                 [(* <root> <root>)]]
             (def (square root)
               (-> Nat Nat)
               (!square root)))])
        ))
