aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/math/infix.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/documentation/lux/math/infix.lux')
-rw-r--r--stdlib/source/documentation/lux/math/infix.lux58
1 files changed, 28 insertions, 30 deletions
diff --git a/stdlib/source/documentation/lux/math/infix.lux b/stdlib/source/documentation/lux/math/infix.lux
index 4f012b257..2e7b35559 100644
--- a/stdlib/source/documentation/lux/math/infix.lux
+++ b/stdlib/source/documentation/lux/math/infix.lux
@@ -1,7 +1,7 @@
(.require
[library
[lux (.except private)
- ["$" documentation (.only documentation:)]
+ ["$" documentation]
[data
["[0]" text (.only \n)
["%" \\format (.only format)]]]
@@ -10,37 +10,35 @@
[\\library
["[0]" /]])
-(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.")
- ["Binary functions"
- (infix [x * +10])
- "=>"
- (* +10 x)]
- ["Nested infix"
- (infix [[x + y] * [x - y]])
- "=>"
- (* (- y x) (+ y x))]
- ["Unary functions"
- (infix [sin [x + y]])
- "=>"
- (sin (+ y x))]
- ["Also works with logic"
- (infix [[x < y] and [y < z]])
- "=>"
- (and (< z y)
- (< y x))]
- ["Forms are left as-is"
- (infix [(* 3 9) gcd 450])
- "=>"
- (gcd 450 (* 3 9))])
-
(.def .public documentation
(.List $.Module)
($.module /._
""
- [..infix]
+ [($.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.")
+ ["Binary functions"
+ (infix [x * +10])
+ "=>"
+ (* +10 x)]
+ ["Nested infix"
+ (infix [[x + y] * [x - y]])
+ "=>"
+ (* (- y x) (+ y x))]
+ ["Unary functions"
+ (infix [sin [x + y]])
+ "=>"
+ (sin (+ y x))]
+ ["Also works with logic"
+ (infix [[x < y] and [y < z]])
+ "=>"
+ (and (< z y)
+ (< y x))]
+ ["Forms are left as-is"
+ (infix [(* 3 9) gcd 450])
+ "=>"
+ (gcd 450 (* 3 9))])]
[]))