aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/world/console.lux
blob: cc3dabc3fe71cd3d5ba3ef4ff08341dc3b4e91c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
(.module:
  [library
   [lux "*"
    ["$" documentation {"+" documentation:}]
    [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)
             ($.default /.cannot_open)
             ($.default /.cannot_close)
             ($.default /.default)]
            []))