(.using
 [library
  [lux "*"
   ["$" documentation {"+" documentation:}]
   ["@" target]
   [control
    ["<>" parser
     ["<[0]>" code]]]
   [data
    ["[0]" text {"+" \n}
     ["%" format {"+" format}]]]
   [macro
    ["[0]" template]]]]
 [\\library
  ["[0]" /]])

(documentation: (/.Console !)
  "An interface to console/terminal I/O.")

(documentation: /.write_line
  "Writes the message on the console and appends a new-line/line-feed at the end."
  [(write_line message console)])

(documentation: (/.Mock s)
  (format "A mock/simulation of a console."
          \n "Useful for testing."))

(documentation: /.mock
  ""
  [(mock mock init)])

(.def: .public documentation
  (.List $.Module)
  (`` (`` ($.module /._
                    ""
                    [..Console
                     ..write_line
                     ..Mock
                     ..mock
                     ($.default /.async)
                     (~~ (for [@.jvm (~~ (as_is ($.default /.cannot_open)
                                                ($.default /.cannot_close)
                                                ($.default /.default)))]
                              (~~ (as_is))))]
                    []))))
