diff options
Diffstat (limited to 'stdlib/source/documentation/lux/math/number')
-rw-r--r-- | stdlib/source/documentation/lux/math/number/complex.lux | 26 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/math/number/frac.lux | 313 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/math/number/i16.lux | 13 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/math/number/i32.lux | 13 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/math/number/i64.lux | 177 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/math/number/i8.lux | 13 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/math/number/int.lux | 207 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/math/number/nat.lux | 111 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/math/number/ratio.lux | 26 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/math/number/rev.lux | 162 |
10 files changed, 479 insertions, 582 deletions
diff --git a/stdlib/source/documentation/lux/math/number/complex.lux b/stdlib/source/documentation/lux/math/number/complex.lux index 9dbe2987f..cf5f3b33f 100644 --- a/stdlib/source/documentation/lux/math/number/complex.lux +++ b/stdlib/source/documentation/lux/math/number/complex.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except private) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,22 +10,11 @@ [\\library ["[0]" /]]) -(documentation: /.Complex - "A complex number.") - -(documentation: /.complex - "Complex literals." - [(complex real imaginary)] - ["The imaginary part can be omitted if it's +0.0." - (complex real)]) - (.def .public documentation (.List $.Module) ($.module /._ "Complex arithmetic." - [..Complex - ..complex - ($.default /.i) + [($.default /.i) ($.default /.+one) ($.default /.-one) ($.default /.zero) @@ -60,5 +49,14 @@ ($.default /.atan) ($.default /.argument) ($.default /.roots) - ($.default /.approximately?)] + ($.default /.approximately?) + + ($.documentation /.Complex + "A complex number.") + + ($.documentation /.complex + "Complex literals." + [(complex real imaginary)] + ["The imaginary part can be omitted if it's +0.0." + (complex real)])] [])) diff --git a/stdlib/source/documentation/lux/math/number/frac.lux b/stdlib/source/documentation/lux/math/number/frac.lux index 20c5b02bf..9fd4f06ce 100644 --- a/stdlib/source/documentation/lux/math/number/frac.lux +++ b/stdlib/source/documentation/lux/math/number/frac.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except private) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,171 +10,146 @@ [\\library ["[0]" /]]) -(documentation: /.= - "Frac(tion) equivalence." - [(= reference sample)]) - -(documentation: /.< - "Frac(tion) less-than." - [(< reference sample)]) - -(documentation: /.<= - "Frac(tion) less-than or equal." - [(<= reference sample)]) - -(documentation: /.> - "Frac(tion) greater-than." - [(> reference sample)]) - -(documentation: /.>= - "Frac(tion) greater-than or equal." - [(>= reference sample)]) - -(with_template [<name> <doc>] - [(documentation: <name> - <doc>)] - - [/.+ "Frac(tion) addition."] - [/.- "Frac(tion) substraction."] - [/.* "Frac(tion) multiplication."] - [/./ "Frac(tion) division."] - [/.% "Frac(tion) remainder."] - ) - -(documentation: /./% - "" - [(/% param subject)]) - -(with_template [<name> <doc>] - [(documentation: <name> - <doc>)] - - [/.min "Frac(tion) minimum."] - [/.max "Frac(tion) minimum."] - ) - -(with_template [<name> <doc>] - [(documentation: <name> - <doc>)] - - [/.not_a_number "Not a number."] - [/.positive_infinity "Positive infinity."] - [/.negative_infinity "Negative infinity."] - ) - -(documentation: /.not_a_number? - "Tests whether a frac is actually not-a-number." - [(not_a_number? it)]) - -(documentation: /.approximately? - "" - [(approximately? margin_of_error standard value)]) - -(documentation: /.mod - "" - [(mod divisor dividend)]) - -(documentation: /.e - "The base of the natural logarithm.") - -(documentation: /.pi - "The ratio of a circle's circumference to its diameter.") - -(documentation: /.tau - "The ratio of a circle's circumference to its radius.") - -(documentation: /.pow - "" - [(pow param subject)]) - -(documentation: /.atan_2 - "" - [(atan_2 x y)]) - -(documentation: /.log_by - "" - [(log_by base it)]) - -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [..= - ..< - ..<= - ..> - ..>= - ..+ - ..- - ..* - ../ - ..% - ../% - ..min - ..max - ..not_a_number - ..positive_infinity - ..negative_infinity - ..not_a_number? - ..approximately? - ..mod - ($.default /.positive?) - ($.default /.negative?) - ($.default /.zero?) - ($.default /.opposite) - ($.default /.abs) - ($.default /.signum) - ($.default /.nat) - ($.default /.int) - ($.default /.rev) - ($.default /.equivalence) - ($.default /.order) - ($.default /.smallest) - ($.default /.biggest) - ($.default /.addition) - ($.default /.multiplication) - ($.default /.minimum) - ($.default /.maximum) - ($.default /.number?) - ($.default /.decimal) - ($.default /.bits) - ($.default /.of_bits) - ($.default /.binary) - ($.default /.octal) - ($.default /.hex) - ($.default /.hash) - - ..e - ..pi - ..tau - ..pow - ..atan_2 - ..log_by - ($.default /.cos) - ($.default /.sin) - ($.default /.tan) - ($.default /.acos) - ($.default /.asin) - ($.default /.atan) - ($.default /.exp) - ($.default /.log) - ($.default /.ceil) - ($.default /.floor) - ($.default /.root_2) - ($.default /.root_3) - ($.default /.round) - ($.default /.factorial) - ($.default /.hypotenuse) - ($.default /.sinh) - ($.default /.csch) - ($.default /.cosh) - ($.default /.sech) - ($.default /.tanh) - ($.default /.coth) - ($.default /.asinh) - ($.default /.acosh) - ($.default /.atanh) - ($.default /.acoth) - ($.default /.asech) - ($.default /.acsch)] - [])) +(`` (.def .public documentation + (.List $.Module) + ($.module /._ + "" + [($.default /.positive?) + ($.default /.negative?) + ($.default /.zero?) + ($.default /.opposite) + ($.default /.abs) + ($.default /.signum) + ($.default /.nat) + ($.default /.int) + ($.default /.rev) + ($.default /.equivalence) + ($.default /.order) + ($.default /.smallest) + ($.default /.biggest) + ($.default /.addition) + ($.default /.multiplication) + ($.default /.minimum) + ($.default /.maximum) + ($.default /.number?) + ($.default /.decimal) + ($.default /.bits) + ($.default /.of_bits) + ($.default /.binary) + ($.default /.octal) + ($.default /.hex) + ($.default /.hash) + + ($.default /.cos) + ($.default /.sin) + ($.default /.tan) + ($.default /.acos) + ($.default /.asin) + ($.default /.atan) + ($.default /.exp) + ($.default /.log) + ($.default /.ceil) + ($.default /.floor) + ($.default /.root_2) + ($.default /.root_3) + ($.default /.round) + ($.default /.factorial) + ($.default /.hypotenuse) + ($.default /.sinh) + ($.default /.csch) + ($.default /.cosh) + ($.default /.sech) + ($.default /.tanh) + ($.default /.coth) + ($.default /.asinh) + ($.default /.acosh) + ($.default /.atanh) + ($.default /.acoth) + ($.default /.asech) + ($.default /.acsch) + + ($.documentation /.= + "Frac(tion) equivalence." + [(= reference sample)]) + + ($.documentation /.< + "Frac(tion) less-than." + [(< reference sample)]) + + ($.documentation /.<= + "Frac(tion) less-than or equal." + [(<= reference sample)]) + + ($.documentation /.> + "Frac(tion) greater-than." + [(> reference sample)]) + + ($.documentation /.>= + "Frac(tion) greater-than or equal." + [(>= reference sample)]) + + (~~ (with_template [<name> <doc>] + [($.documentation <name> + <doc>)] + + [/.+ "Frac(tion) addition."] + [/.- "Frac(tion) substraction."] + [/.* "Frac(tion) multiplication."] + [/./ "Frac(tion) division."] + [/.% "Frac(tion) remainder."] + )) + + ($.documentation /./% + "" + [(/% param subject)]) + + (~~ (with_template [<name> <doc>] + [($.documentation <name> + <doc>)] + + [/.min "Frac(tion) minimum."] + [/.max "Frac(tion) minimum."] + )) + + (~~ (with_template [<name> <doc>] + [($.documentation <name> + <doc>)] + + [/.not_a_number "Not a number."] + [/.positive_infinity "Positive infinity."] + [/.negative_infinity "Negative infinity."] + )) + + ($.documentation /.not_a_number? + "Tests whether a frac is actually not-a-number." + [(not_a_number? it)]) + + ($.documentation /.approximately? + "" + [(approximately? margin_of_error standard value)]) + + ($.documentation /.mod + "" + [(mod divisor dividend)]) + + ($.documentation /.e + "The base of the natural logarithm.") + + ($.documentation /.pi + "The ratio of a circle's circumference to its diameter.") + + ($.documentation /.tau + "The ratio of a circle's circumference to its radius.") + + ($.documentation /.pow + "" + [(pow param subject)]) + + ($.documentation /.atan_2 + "" + [(atan_2 x y)]) + + ($.documentation /.log_by + "" + [(log_by base it)])] + []))) diff --git a/stdlib/source/documentation/lux/math/number/i16.lux b/stdlib/source/documentation/lux/math/number/i16.lux index d46156fe3..20c6ac061 100644 --- a/stdlib/source/documentation/lux/math/number/i16.lux +++ b/stdlib/source/documentation/lux/math/number/i16.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except private) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,16 +10,15 @@ [\\library ["[0]" /]]) -(documentation: /.I16 - "A 16-bit integer.") - (.def .public documentation (.List $.Module) ($.module /._ "" - [..I16 - ($.default /.equivalence) + [($.default /.equivalence) ($.default /.width) ($.default /.i16) - ($.default /.i64)] + ($.default /.i64) + + ($.documentation /.I16 + "A 16-bit integer.")] [])) diff --git a/stdlib/source/documentation/lux/math/number/i32.lux b/stdlib/source/documentation/lux/math/number/i32.lux index f621611fb..f092d9aa9 100644 --- a/stdlib/source/documentation/lux/math/number/i32.lux +++ b/stdlib/source/documentation/lux/math/number/i32.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except private) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,16 +10,15 @@ [\\library ["[0]" /]]) -(documentation: /.I32 - "A 32-bit integer.") - (.def .public documentation (.List $.Module) ($.module /._ "" - [..I32 - ($.default /.equivalence) + [($.default /.equivalence) ($.default /.width) ($.default /.i32) - ($.default /.i64)] + ($.default /.i64) + + ($.documentation /.I32 + "A 32-bit integer.")] [])) diff --git a/stdlib/source/documentation/lux/math/number/i64.lux b/stdlib/source/documentation/lux/math/number/i64.lux index bbe28089d..b11806f7d 100644 --- a/stdlib/source/documentation/lux/math/number/i64.lux +++ b/stdlib/source/documentation/lux/math/number/i64.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except or and not) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,100 +10,81 @@ [\\library ["[0]" /]]) -(with_template [<name> <doc>] - [(documentation: <name> - <doc>)] - - [/.or "Bitwise or."] - [/.xor "Bitwise xor."] - [/.and "Bitwise and."] - - [/.left_shifted "Bitwise left-shift."] - [/.right_shifted "Unsigned/logic bitwise right-shift."] - ) - -(documentation: /.Mask - "A pattern of bits that can be imposed on I64 values.") - -(documentation: /.bit - "A mask with only a specific bit set." - [(bit position)]) - -(documentation: /.sign - "A mask for the sign bit of ints.") - -(documentation: /.not - "Bitwise negation.") - -(documentation: /.mask - "Mask a block of bits of the specified size." - [(mask amount_of_bits)]) - -(documentation: /.ones - "Count the number of 1s in a bit-map." - [(ones it)]) - -(with_template [<name> <doc>] - [(documentation: <name> - <doc>)] - - [/.zero "Clear bit at the given index."] - [/.one "Set bit at given index."] - [/.flipped "Flip bit at given index."] - ) - -(documentation: /.one? - "" - [(one? index input)]) - -(documentation: /.zero? - "" - [(zero? index input)]) - -(documentation: /.region - "A mask for a block of bits of the given size, starting at the given offset." - [(region offset size)]) - -(documentation: (/.Sub width) - "A sub-space of I64 with a reduce amount of bits.") - -(documentation: /.sub - "Given a width in the interval (0,64), yields an implementation for integers of that width." - [(sub width)]) - -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [..or - ..xor - ..and - ..left_shifted - ..right_shifted - ..Mask - ..bit - ..sign - ..not - ..mask - ..ones - ..zero - ..one - ..flipped - ..one? - ..zero? - ..region - ..Sub - ..sub - ($.default /.bits_per_byte) - ($.default /.bytes_per_i64) - ($.default /.width) - ($.default /.false) - ($.default /.true) - ($.default /.equivalence) - ($.default /.hash) - ($.default /.disjunction) - ($.default /.conjunction) - ($.default /.reversed) - ($.default /.left_rotated) - ($.default /.right_rotated)] - [])) +(`` (.def .public documentation + (.List $.Module) + ($.module /._ + "" + [($.default /.bits_per_byte) + ($.default /.bytes_per_i64) + ($.default /.width) + ($.default /.false) + ($.default /.true) + ($.default /.equivalence) + ($.default /.hash) + ($.default /.disjunction) + ($.default /.conjunction) + ($.default /.reversed) + ($.default /.left_rotated) + ($.default /.right_rotated) + + (~~ (with_template [<name> <doc>] + [($.documentation <name> + <doc>)] + + [/.or "Bitwise or."] + [/.xor "Bitwise xor."] + [/.and "Bitwise and."] + + [/.left_shifted "Bitwise left-shift."] + [/.right_shifted "Unsigned/logic bitwise right-shift."] + )) + + ($.documentation /.Mask + "A pattern of bits that can be imposed on I64 values.") + + ($.documentation /.bit + "A mask with only a specific bit set." + [(bit position)]) + + ($.documentation /.sign + "A mask for the sign bit of ints.") + + ($.documentation /.not + "Bitwise negation.") + + ($.documentation /.mask + "Mask a block of bits of the specified size." + [(mask amount_of_bits)]) + + ($.documentation /.ones + "Count the number of 1s in a bit-map." + [(ones it)]) + + (~~ (with_template [<name> <doc>] + [($.documentation <name> + <doc>)] + + [/.zero "Clear bit at the given index."] + [/.one "Set bit at given index."] + [/.flipped "Flip bit at given index."] + )) + + ($.documentation /.one? + "" + [(one? index input)]) + + ($.documentation /.zero? + "" + [(zero? index input)]) + + ($.documentation /.region + "A mask for a block of bits of the given size, starting at the given offset." + [(region offset size)]) + + ($.documentation (/.Sub width) + "A sub-space of I64 with a reduce amount of bits.") + + ($.documentation /.sub + "Given a width in the interval (0,64), yields an implementation for integers of that width." + [(sub width)])] + []))) diff --git a/stdlib/source/documentation/lux/math/number/i8.lux b/stdlib/source/documentation/lux/math/number/i8.lux index 5b73e0e13..f7893d393 100644 --- a/stdlib/source/documentation/lux/math/number/i8.lux +++ b/stdlib/source/documentation/lux/math/number/i8.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except private) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,16 +10,15 @@ [\\library ["[0]" /]]) -(documentation: /.I8 - "A 8-bit integer.") - (.def .public documentation (.List $.Module) ($.module /._ "" - [..I8 - ($.default /.equivalence) + [($.default /.equivalence) ($.default /.width) ($.default /.i8) - ($.default /.i64)] + ($.default /.i64) + + ($.documentation /.I8 + "A 8-bit integer.")] [])) diff --git a/stdlib/source/documentation/lux/math/number/int.lux b/stdlib/source/documentation/lux/math/number/int.lux index f7edc45a2..088f8e87f 100644 --- a/stdlib/source/documentation/lux/math/number/int.lux +++ b/stdlib/source/documentation/lux/math/number/int.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except private) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,116 +10,95 @@ [\\library ["[0]" /]]) -(documentation: /.= - "Int(eger) equivalence." - [(= reference sample)]) - -(documentation: /.< - "Int(eger) less-than." - [(< reference sample)]) - -(documentation: /.<= - "Int(eger) less-than or equal." - [(<= reference sample)]) - -(documentation: /.> - "Int(eger) greater-than." - [(> reference sample)]) - -(documentation: /.>= - "Int(eger) greater-than or equal." - [(>= reference sample)]) - -(with_template [<name> <doc>] - [(documentation: <name> - <doc>)] - - [/.min "Int(eger) minimum."] - [/.max "Int(eger) maximum."] - ) - -(with_template [<name> <doc>] - [(documentation: <name> - <doc>)] - - [/.+ "Int(eger) addition."] - [/.- "Int(eger) substraction."] - [/.* "Int(eger) multiplication."] - [/./ "Int(eger) division."] - [/.% "Int(eger) remainder."] - [/./% "Int(eger) [division remainder]."] - ) - -(documentation: /.opposite - "A value of equal magnitude and opposite sign.") - -(documentation: /.abs - "A value of equal magnitude and positive sign.") - -(documentation: /.signum - "A value (either -1, 0 or +0) which represents the sign.") - -(documentation: /.mod - (format "Integer modulo." - \n "Note: The modulo and the remainder are not the same.") - [(mod divisor dividend)]) - -(documentation: /.gcd - "Greatest Common Divisor.") - -(documentation: /.extended_gcd - "Extended euclidean algorithm.") - -(documentation: /.lcm - "Least Common Multiple.") - -(documentation: /.right_shifted - "Signed/arithmetic bitwise right-shift." - [(right_shifted parameter subject)]) - -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [..= - ..< - ..<= - ..> - ..>= - ..min - ..max - ..+ - ..- - ..* - ../ - ..% - ../% - ..opposite - ..abs - ..signum - ..mod - ..gcd - ..extended_gcd - ..lcm - ..right_shifted - ($.default /.positive?) - ($.default /.negative?) - ($.default /.zero?) - ($.default /.even?) - ($.default /.odd?) - ($.default /.co_prime?) - ($.default /.frac) - ($.default /.equivalence) - ($.default /.order) - ($.default /.enum) - ($.default /.interval) - ($.default /.addition) - ($.default /.multiplication) - ($.default /.maximum) - ($.default /.minimum) - ($.default /.binary) - ($.default /.octal) - ($.default /.decimal) - ($.default /.hex) - ($.default /.hash)] - [])) +(`` (.def .public documentation + (.List $.Module) + ($.module /._ + "" + [($.default /.positive?) + ($.default /.negative?) + ($.default /.zero?) + ($.default /.even?) + ($.default /.odd?) + ($.default /.co_prime?) + ($.default /.frac) + ($.default /.equivalence) + ($.default /.order) + ($.default /.enum) + ($.default /.interval) + ($.default /.addition) + ($.default /.multiplication) + ($.default /.maximum) + ($.default /.minimum) + ($.default /.binary) + ($.default /.octal) + ($.default /.decimal) + ($.default /.hex) + ($.default /.hash) + + ($.documentation /.= + "Int(eger) equivalence." + [(= reference sample)]) + + ($.documentation /.< + "Int(eger) less-than." + [(< reference sample)]) + + ($.documentation /.<= + "Int(eger) less-than or equal." + [(<= reference sample)]) + + ($.documentation /.> + "Int(eger) greater-than." + [(> reference sample)]) + + ($.documentation /.>= + "Int(eger) greater-than or equal." + [(>= reference sample)]) + + (~~ (with_template [<name> <doc>] + [($.documentation <name> + <doc>)] + + [/.min "Int(eger) minimum."] + [/.max "Int(eger) maximum."] + )) + + (~~ (with_template [<name> <doc>] + [($.documentation <name> + <doc>)] + + [/.+ "Int(eger) addition."] + [/.- "Int(eger) substraction."] + [/.* "Int(eger) multiplication."] + [/./ "Int(eger) division."] + [/.% "Int(eger) remainder."] + [/./% "Int(eger) [division remainder]."] + )) + + ($.documentation /.opposite + "A value of equal magnitude and opposite sign.") + + ($.documentation /.abs + "A value of equal magnitude and positive sign.") + + ($.documentation /.signum + "A value (either -1, 0 or +0) which represents the sign.") + + ($.documentation /.mod + (format "Integer modulo." + \n "Note: The modulo and the remainder are not the same.") + [(mod divisor dividend)]) + + ($.documentation /.gcd + "Greatest Common Divisor.") + + ($.documentation /.extended_gcd + "Extended euclidean algorithm.") + + ($.documentation /.lcm + "Least Common Multiple.") + + ($.documentation /.right_shifted + "Signed/arithmetic bitwise right-shift." + [(right_shifted parameter subject)])] + []))) diff --git a/stdlib/source/documentation/lux/math/number/nat.lux b/stdlib/source/documentation/lux/math/number/nat.lux index fff664713..5bf379bba 100644 --- a/stdlib/source/documentation/lux/math/number/nat.lux +++ b/stdlib/source/documentation/lux/math/number/nat.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except private) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,71 +10,56 @@ [\\library ["[0]" /]]) -(with_template [<name> <documentation>] - [(documentation: <name> - <documentation>)] +(`` (.def .public documentation + (.List $.Module) + ($.module /._ + "" + [($.default /.co_prime?) + ($.default /.even?) + ($.default /.odd?) + ($.default /.frac) + ($.default /.equivalence) + ($.default /.order) + ($.default /.enum) + ($.default /.interval) + ($.default /.addition) + ($.default /.multiplication) + ($.default /.minimum) + ($.default /.maximum) + ($.default /.binary) + ($.default /.octal) + ($.default /.hex) + ($.default /.decimal) + ($.default /.hash) - [/.= "Nat(ural) equivalence."] - [/.+ "Nat(ural) addition."] - [/.- "Nat(ural) substraction."] - [/.< "Nat(ural) less-than."] - [/.<= "Nat(ural) less-than or equal."] - [/.> "Nat(ural) greater-than."] - [/.>= "Nat(ural) greater-than or equal."] - [/.* "Nat(ural) multiplication."] - [/./ "Nat(ural) division."] - [/./% "Nat(ural) [division remainder]."] - [/.% "Nat(ural) remainder."] - ) + (~~ (with_template [<name> <documentation>] + [($.documentation <name> + <documentation>)] -(with_template [<name> <doc>] - [(documentation: <name> - <doc>)] + [/.= "Nat(ural) equivalence."] + [/.+ "Nat(ural) addition."] + [/.- "Nat(ural) substraction."] + [/.< "Nat(ural) less-than."] + [/.<= "Nat(ural) less-than or equal."] + [/.> "Nat(ural) greater-than."] + [/.>= "Nat(ural) greater-than or equal."] + [/.* "Nat(ural) multiplication."] + [/./ "Nat(ural) division."] + [/./% "Nat(ural) [division remainder]."] + [/.% "Nat(ural) remainder."] + )) - [/.min "Nat(ural) minimum."] - [/.max "Nat(ural) maximum."] - ) + (~~ (with_template [<name> <doc>] + [($.documentation <name> + <doc>)] -(documentation: /.gcd - "Greatest Common Divisor.") + [/.min "Nat(ural) minimum."] + [/.max "Nat(ural) maximum."] + )) -(documentation: /.lcm - "Least Common Multiple.") + ($.documentation /.gcd + "Greatest Common Divisor.") -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [..= - ..+ - ..- - ..< - ..<= - ..> - ..>= - ..* - ../ - ../% - ..% - ..min - ..max - ..gcd - ..lcm - ($.default /.co_prime?) - ($.default /.even?) - ($.default /.odd?) - ($.default /.frac) - ($.default /.equivalence) - ($.default /.order) - ($.default /.enum) - ($.default /.interval) - ($.default /.addition) - ($.default /.multiplication) - ($.default /.minimum) - ($.default /.maximum) - ($.default /.binary) - ($.default /.octal) - ($.default /.hex) - ($.default /.decimal) - ($.default /.hash)] - [])) + ($.documentation /.lcm + "Least Common Multiple.")] + []))) diff --git a/stdlib/source/documentation/lux/math/number/ratio.lux b/stdlib/source/documentation/lux/math/number/ratio.lux index 5a1d7d71a..3bd835a57 100644 --- a/stdlib/source/documentation/lux/math/number/ratio.lux +++ b/stdlib/source/documentation/lux/math/number/ratio.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except private) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,22 +10,11 @@ [\\library ["[0]" /]]) -(documentation: /.Ratio - "An unsigned ratio of numbers.") - -(documentation: /.ratio - "Rational literals." - [(ratio numerator denominator)] - ["The denominator can be omitted if it is 1." - (ratio numerator)]) - (.def .public documentation (.List $.Module) ($.module /._ "Rational numbers." - [..Ratio - ..ratio - ($.default /.nat) + [($.default /.nat) ($.default /.=) ($.default /.equivalence) ($.default /.<) @@ -41,5 +30,14 @@ ($.default /.reciprocal) ($.default /.codec) ($.default /.addition) - ($.default /.multiplication)] + ($.default /.multiplication) + + ($.documentation /.Ratio + "An unsigned ratio of numbers.") + + ($.documentation /.ratio + "Rational literals." + [(ratio numerator denominator)] + ["The denominator can be omitted if it is 1." + (ratio numerator)])] [])) diff --git a/stdlib/source/documentation/lux/math/number/rev.lux b/stdlib/source/documentation/lux/math/number/rev.lux index 4fab63f3e..5450725b8 100644 --- a/stdlib/source/documentation/lux/math/number/rev.lux +++ b/stdlib/source/documentation/lux/math/number/rev.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except private) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,103 +10,87 @@ [\\library ["[0]" /]]) -(documentation: /.= - "Rev(olution) equivalence." - [(= reference sample)]) +(`` (.def .public documentation + (.List $.Module) + ($.module /._ + "" + [($.default /./1) + ($.default /./2) + ($.default /./4) + ($.default /./8) + ($.default /./16) + ($.default /./32) + ($.default /./64) + ($.default /./128) + ($.default /./256) + ($.default /./512) + ($.default /./1024) + ($.default /./2048) + ($.default /./4096) + ($.default /./%) + ($.default /.frac) + ($.default /.equivalence) + ($.default /.hash) + ($.default /.order) + ($.default /.enum) + ($.default /.interval) + ($.default /.addition) + ($.default /.maximum) + ($.default /.minimum) + ($.default /.binary) + ($.default /.octal) + ($.default /.hex) + ($.default /.decimal) -(documentation: /.< - "Rev(olution) less-than." - [(< reference sample)]) + ($.documentation /.= + "Rev(olution) equivalence." + [(= reference sample)]) -(documentation: /.<= - "Rev(olution) less-than or equal." - [(<= reference sample)]) + ($.documentation /.< + "Rev(olution) less-than." + [(< reference sample)]) -(documentation: /.> - "Rev(olution) greater-than." - [(> reference sample)]) + ($.documentation /.<= + "Rev(olution) less-than or equal." + [(<= reference sample)]) -(documentation: /.>= - "Rev(olution) greater-than or equal." - [(>= reference sample)]) + ($.documentation /.> + "Rev(olution) greater-than." + [(> reference sample)]) -(with_template [<name> <doc>] - [(documentation: <name> - <doc>)] + ($.documentation /.>= + "Rev(olution) greater-than or equal." + [(>= reference sample)]) - [/.min "Rev(olution) minimum."] - [/.max "Rev(olution) maximum."] - ) + (~~ (with_template [<name> <doc>] + [($.documentation <name> + <doc>)] -(with_template [<name> <doc>] - [(documentation: <name> - <doc>)] + [/.min "Rev(olution) minimum."] + [/.max "Rev(olution) maximum."] + )) - [/.+ "Rev(olution) addition."] - [/.- "Rev(olution) substraction."] - [/.* "Rev(olution) multiplication."] - [/./ "Rev(olution) division."] - [/.% "Rev(olution) remainder."] - [/.ratio "Ratio between two rev(olution)s."] - ) + (~~ (with_template [<name> <doc>] + [($.documentation <name> + <doc>)] -(documentation: /.up - "" - [(up scale subject)]) + [/.+ "Rev(olution) addition."] + [/.- "Rev(olution) substraction."] + [/.* "Rev(olution) multiplication."] + [/./ "Rev(olution) division."] + [/.% "Rev(olution) remainder."] + [/.ratio "Ratio between two rev(olution)s."] + )) -(documentation: /.down - "" - [(down scale subject)]) + ($.documentation /.up + "" + [(up scale subject)]) -(documentation: /.reciprocal - "Rev(olution) reciprocal of a Nat(ural)." - [(reciprocal numerator)]) + ($.documentation /.down + "" + [(down scale subject)]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [..= - ..< - ..<= - ..> - ..>= - ..min - ..max - ..+ - ..- - ..* - ../ - ..% - ..ratio - ..up - ..down - ..reciprocal - ($.default /./1) - ($.default /./2) - ($.default /./4) - ($.default /./8) - ($.default /./16) - ($.default /./32) - ($.default /./64) - ($.default /./128) - ($.default /./256) - ($.default /./512) - ($.default /./1024) - ($.default /./2048) - ($.default /./4096) - ($.default /./%) - ($.default /.frac) - ($.default /.equivalence) - ($.default /.hash) - ($.default /.order) - ($.default /.enum) - ($.default /.interval) - ($.default /.addition) - ($.default /.maximum) - ($.default /.minimum) - ($.default /.binary) - ($.default /.octal) - ($.default /.hex) - ($.default /.decimal)] - [])) + ($.documentation /.reciprocal + "Rev(olution) reciprocal of a Nat(ural)." + [(reciprocal numerator)])] + []))) |