aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/math/infix.lux
blob: 37f4959a33b02fe58ba2de3ff2ce332690871290 (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
(.module:
  [library
   [lux (#- private)
    ["$" documentation (#+ documentation:)]
    [data
     ["." text (#+ \n)
      ["%" format (#+ format)]]]
    [macro
     ["." template]]]]
  [\\library
   ["." /]])

(documentation: /.infix
  (format "Infix math syntax."
          \n "The rules for infix syntax are simple."
          \n "If you want your binary function to work well with it."
          \n "Then take the argument to the right (y) as your first argument,"
          \n "and take the argument to the left (x) as your second argument.")
  [(infix [x * +10])]
  [(infix [[x + y] * [x - y]])]
  [(infix [sin [x + y]])]
  [(infix [[x < y] and [y < z]])]
  [(infix [(* 3 9) gcd 450])])

(.def: .public documentation
  (.List $.Module)
  ($.module /._
            ""
            [..infix]
            []))