diff options
author | Eduardo Julian | 2022-06-27 02:25:56 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-06-27 02:25:56 -0400 |
commit | 3265f6a71723c100559eaea188d3762ceedce3b9 (patch) | |
tree | cc40dcba71869812a60227f454b7986a2a465043 /stdlib/source/documentation | |
parent | f0c5b0eae885b73de243cb463b017a20cb47646d (diff) |
Extensible spliced un-quoting.
Diffstat (limited to 'stdlib/source/documentation')
22 files changed, 816 insertions, 999 deletions
diff --git a/stdlib/source/documentation/lux/math.lux b/stdlib/source/documentation/lux/math.lux index 1801500b2..9453ec02d 100644 --- a/stdlib/source/documentation/lux/math.lux +++ b/stdlib/source/documentation/lux/math.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text ["%" \\format (.only format)]] 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))])] [])) diff --git a/stdlib/source/documentation/lux/math/logic.lux b/stdlib/source/documentation/lux/math/logic.lux index 3fe60764e..7639dad90 100644 --- a/stdlib/source/documentation/lux/math/logic.lux +++ b/stdlib/source/documentation/lux/math/logic.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except char) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text ["%" \\format (.only format)]] diff --git a/stdlib/source/documentation/lux/math/logic/continuous.lux b/stdlib/source/documentation/lux/math/logic/continuous.lux index 9ec977e29..b97474b28 100644 --- a/stdlib/source/documentation/lux/math/logic/continuous.lux +++ b/stdlib/source/documentation/lux/math/logic/continuous.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except private) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,23 +10,22 @@ [\\library ["[0]" /]]) -(documentation: /.implies - "" - [(implies consequent antecedent)]) - (.def .public documentation (.List $.Module) ($.module /._ (format "Continuous logic using Rev values." \n "Continuous logic is logic in the interval [0,1] instead of just the binary #0 and #1 options." \n "Because Rev is being used, the interval is actual [0,1).") - [..implies - ($.default /.false) + [($.default /.false) ($.default /.true) ($.default /.or) ($.default /.disjunction) ($.default /.and) ($.default /.conjunction) ($.default /.not) - ($.default /.=)] + ($.default /.=) + + ($.documentation /.implies + "" + [(implies consequent antecedent)])] [])) diff --git a/stdlib/source/documentation/lux/math/logic/fuzzy.lux b/stdlib/source/documentation/lux/math/logic/fuzzy.lux index ead5d4011..47b5c235d 100644 --- a/stdlib/source/documentation/lux/math/logic/fuzzy.lux +++ b/stdlib/source/documentation/lux/math/logic/fuzzy.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except private) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,59 +10,50 @@ [\\library ["[0]" /]]) -(documentation: (/.Fuzzy it) - "A fuzzy set.") - -(documentation: /.membership - "" - [(membership set elem)]) - -(documentation: /.difference - "" - [(difference sub base)]) - -(documentation: /.of_predicate - "" - [(of_predicate predicate)]) - -(documentation: /.predicate - "" - [(predicate treshold set)]) - -(documentation: /.gradient - "" - [(gradient from to)]) - -(documentation: /.triangle - "" - [(triangle bottom middle top)]) - -(documentation: /.trapezoid - "" - [(trapezoid bottom middle_bottom middle_top top)]) - -(documentation: /.cut - "" - [(cut treshold set)]) - (.def .public documentation (.List $.Module) ($.module /._ "Fuzzy logic, implemented on top of the Rev type." - [..Fuzzy - ..membership - ..difference - ..of_predicate - ..predicate - ..gradient - ..triangle - ..trapezoid - ..cut - ($.default /.functor) + [($.default /.functor) ($.default /.empty) ($.default /.full) ($.default /.union) ($.default /.intersection) ($.default /.complement) - ($.default /.of_set)] + ($.default /.of_set) + + ($.documentation (/.Fuzzy it) + "A fuzzy set.") + + ($.documentation /.membership + "" + [(membership set elem)]) + + ($.documentation /.difference + "" + [(difference sub base)]) + + ($.documentation /.of_predicate + "" + [(of_predicate predicate)]) + + ($.documentation /.predicate + "" + [(predicate treshold set)]) + + ($.documentation /.gradient + "" + [(gradient from to)]) + + ($.documentation /.triangle + "" + [(triangle bottom middle top)]) + + ($.documentation /.trapezoid + "" + [(trapezoid bottom middle_bottom middle_top top)]) + + ($.documentation /.cut + "" + [(cut treshold set)])] [])) diff --git a/stdlib/source/documentation/lux/math/modular.lux b/stdlib/source/documentation/lux/math/modular.lux index b83bcce51..fe39e1b40 100644 --- a/stdlib/source/documentation/lux/math/modular.lux +++ b/stdlib/source/documentation/lux/math/modular.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except private) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,25 +10,11 @@ [\\library ["[0]" /]]) -(documentation: (/.Mod %) - "A number under a modulus.") - -(documentation: /.modular - "" - [(modular modulus value)]) - -(documentation: /.adapter - "" - [(adapter reference subject)]) - (.def .public documentation (.List $.Module) ($.module /._ "" - [..Mod - ..modular - ..adapter - ($.default /.modulus) + [($.default /.modulus) ($.default /.value) ($.default /.incorrect_modulus) ($.default /.codec) @@ -49,5 +35,16 @@ ($.default /.addition) ($.default /.multiplication) ($.default /.inverse) - ($.default /.moduli_are_not_equal)] + ($.default /.moduli_are_not_equal) + + ($.documentation (/.Mod %) + "A number under a modulus.") + + ($.documentation /.modular + "" + [(modular modulus value)]) + + ($.documentation /.adapter + "" + [(adapter reference subject)])] [])) diff --git a/stdlib/source/documentation/lux/math/modulus.lux b/stdlib/source/documentation/lux/math/modulus.lux index 51273b5b0..4f0d17564 100644 --- a/stdlib/source/documentation/lux/math/modulus.lux +++ b/stdlib/source/documentation/lux/math/modulus.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except private) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,30 +10,27 @@ [\\library ["[0]" /]]) -(documentation: (/.Modulus %) - (format "A number used as a modulus in modular arithmetic." - \n "It cannot be 0.")) - -(documentation: /.congruent? - "" - [(congruent? modulus reference subject)]) - -(documentation: /.literal - "" - ["Success!" - (literal 123)] - ["Failure!" - (literal 0)]) - (.def .public documentation (.List $.Module) ($.module /._ "" - [..Modulus - ..congruent? - ..literal - ($.default /.zero_cannot_be_a_modulus) + [($.default /.zero_cannot_be_a_modulus) ($.default /.modulus) ($.default /.divisor) - ($.default /.=)] + ($.default /.=) + + ($.documentation (/.Modulus %) + (format "A number used as a modulus in modular arithmetic." + \n "It cannot be 0.")) + + ($.documentation /.congruent? + "" + [(congruent? modulus reference subject)]) + + ($.documentation /.literal + "" + ["Success!" + (literal 123)] + ["Failure!" + (literal 0)])] [])) diff --git a/stdlib/source/documentation/lux/math/number.lux b/stdlib/source/documentation/lux/math/number.lux index 22d93048d..c63a71371 100644 --- a/stdlib/source/documentation/lux/math/number.lux +++ b/stdlib/source/documentation/lux/math/number.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except private) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -21,32 +21,28 @@ ["[1][0]" ratio] ["[1][0]" complex]]) -(with_template [<name> <encoding> <no_commas> <with_commas>] - [(documentation: <name> - (format "Given syntax for a " <encoding> " number, generates a Nat, an Int, a Rev or a Frac.") - [<no_commas>] - ["Allows for the presence of commas (,) among the digits." - <with_commas>])] +(`` (.def .public documentation + (.List $.Module) + ($.module /._ + "" + [(~~ (with_template [<name> <encoding> <no_commas> <with_commas>] + [($.documentation <name> + (format "Given syntax for a " <encoding> " number, generates a Nat, an Int, a Rev or a Frac.") + [<no_commas>] + ["Allows for the presence of commas (,) among the digits." + <with_commas>])] - [/.bin "binary" (bin "11001001") (bin "11,00,10,01")] - [/.oct "octal" (oct "615243") (oct "615,243")] - [/.hex "hexadecimal" (hex "deadBEEF") (hex "dead,BEEF")] - ) - -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [..bin - ..oct - ..hex] - [/i8.documentation - /i16.documentation - /i32.documentation - /i64.documentation - /nat.documentation - /int.documentation - /rev.documentation - /frac.documentation - /ratio.documentation - /complex.documentation])) + [/.bin "binary" (bin "11001001") (bin "11,00,10,01")] + [/.oct "octal" (oct "615243") (oct "615,243")] + [/.hex "hexadecimal" (hex "deadBEEF") (hex "dead,BEEF")] + ))] + [/i8.documentation + /i16.documentation + /i32.documentation + /i64.documentation + /nat.documentation + /int.documentation + /rev.documentation + /frac.documentation + /ratio.documentation + /complex.documentation]))) 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)])] + []))) diff --git a/stdlib/source/documentation/lux/math/random.lux b/stdlib/source/documentation/lux/math/random.lux index 5a4208538..0e0d88ec9 100644 --- a/stdlib/source/documentation/lux/math/random.lux +++ b/stdlib/source/documentation/lux/math/random.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except or and nat int rev) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,97 +10,11 @@ [\\library ["[0]" /]]) -(documentation: /.PRNG - "An abstract way to represent any PRNG.") - -(documentation: (/.Random it) - "A producer of random values based on a PRNG.") - -(documentation: /.only - "Retries the generator until the output satisfies a predicate." - [(only pred gen)]) - -(documentation: /.one - "" - [(one check random)]) - -(documentation: /.refined - "Retries the generator until the output can be refined." - [(refined refiner gen)]) - -(documentation: /.safe_frac - "A number in the interval [0.0,1.0].") - -(documentation: /.text - "" - [(text char_gen size)]) - -(documentation: /.and - "Sequencing combinator." - [(and left right)]) - -(documentation: /.or - "Heterogeneous alternative combinator." - [(or left right)]) - -(documentation: /.either - "Homogeneous alternative combinator." - [(either left right)]) - -(documentation: /.rec - "A combinator for producing recursive random generators." - [(rec gen)]) - -(documentation: /.set - "" - [(set hash size value_gen)]) - -(documentation: /.dictionary - "" - [(dictionary hash size key_gen value_gen)]) - -(documentation: /.result - "" - [(result prng calc)]) - -(documentation: /.prng - "" - [(prng update return)]) - -(documentation: /.pcg_32 - (format "An implementation of the PCG32 algorithm." - \n "For more information, please see: http://www.pcg-random.org/")) - -(documentation: /.xoroshiro_128+ - (format "An implementation of the Xoroshiro128+ algorithm." - \n "For more information, please see: http://xoroshiro.di.unimi.it/")) - -(documentation: /.split_mix_64 - "An implementation of the SplitMix64 algorithm.") - (.def .public documentation (.List $.Module) ($.module /._ "Pseudo-random number generation (PRNG) algorithms." - [..PRNG - ..Random - ..only - ..one - ..refined - ..safe_frac - ..text - ..and - ..or - ..either - ..rec - ..set - ..dictionary - ..result - ..prng - ..pcg_32 - ..xoroshiro_128+ - ..split_mix_64 - ($.default /.functor) + [($.default /.functor) ($.default /.apply) ($.default /.monad) @@ -135,5 +49,73 @@ ($.default /.time) ($.default /.duration) ($.default /.month) - ($.default /.day)] + ($.default /.day) + + ($.documentation /.PRNG + "An abstract way to represent any PRNG.") + + ($.documentation (/.Random it) + "A producer of random values based on a PRNG.") + + ($.documentation /.only + "Retries the generator until the output satisfies a predicate." + [(only pred gen)]) + + ($.documentation /.one + "" + [(one check random)]) + + ($.documentation /.refined + "Retries the generator until the output can be refined." + [(refined refiner gen)]) + + ($.documentation /.safe_frac + "A number in the interval [0.0,1.0].") + + ($.documentation /.text + "" + [(text char_gen size)]) + + ($.documentation /.and + "Sequencing combinator." + [(and left right)]) + + ($.documentation /.or + "Heterogeneous alternative combinator." + [(or left right)]) + + ($.documentation /.either + "Homogeneous alternative combinator." + [(either left right)]) + + ($.documentation /.rec + "A combinator for producing recursive random generators." + [(rec gen)]) + + ($.documentation /.set + "" + [(set hash size value_gen)]) + + ($.documentation /.dictionary + "" + [(dictionary hash size key_gen value_gen)]) + + ($.documentation /.result + "" + [(result prng calc)]) + + ($.documentation /.prng + "" + [(prng update return)]) + + ($.documentation /.pcg_32 + (format "An implementation of the PCG32 algorithm." + \n "For more information, please see: http://www.pcg-random.org/")) + + ($.documentation /.xoroshiro_128+ + (format "An implementation of the Xoroshiro128+ algorithm." + \n "For more information, please see: http://xoroshiro.di.unimi.it/")) + + ($.documentation /.split_mix_64 + "An implementation of the SplitMix64 algorithm.")] [])) diff --git a/stdlib/source/documentation/lux/meta.lux b/stdlib/source/documentation/lux/meta.lux index 651c465ea..dfe0b27bd 100644 --- a/stdlib/source/documentation/lux/meta.lux +++ b/stdlib/source/documentation/lux/meta.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except macro) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -13,190 +13,154 @@ ["[1][0]" location] ["[1][0]" symbol]]) -(documentation: /.result' - (format "Evaluates a computation that depends on Lux's compiler state." - \n "Also returns a (potentially modified) compiler state.") - [(result' lux action)]) +(.def .public documentation + (.List $.Module) + ($.module /._ + "Functions for extracting information from the state of the compiler." + [($.default /.functor) + ($.default /.apply) + ($.default /.monad) + ($.default /.lifted) + ($.default /.try) -(documentation: /.result - "Evaluates a computation that depends on Lux's compiler state." - [(result lux action)]) + ($.documentation /.result' + (format "Evaluates a computation that depends on Lux's compiler state." + \n "Also returns a (potentially modified) compiler state.") + [(result' lux action)]) -(documentation: /.either - "Pick whichever computation succeeds." - [(either left right)]) + ($.documentation /.result + "Evaluates a computation that depends on Lux's compiler state." + [(result lux action)]) -(documentation: /.assertion - "Fails with the given message if the test is #0." - [(assertion message test)]) + ($.documentation /.either + "Pick whichever computation succeeds." + [(either left right)]) -(documentation: /.failure - "Fails with the given error message." - [(failure error)]) + ($.documentation /.assertion + "Fails with the given message if the test is #0." + [(assertion message test)]) -(documentation: /.module - "Looks-up a module with the given name." - [(module name)]) + ($.documentation /.failure + "Fails with the given error message." + [(failure error)]) -(documentation: /.current_module_name - "The name of the module currently being compiled, if any.") + ($.documentation /.module + "Looks-up a module with the given name." + [(module name)]) -(documentation: /.current_module - "The module currently being compiled, if any.") + ($.documentation /.current_module_name + "The name of the module currently being compiled, if any.") -(documentation: /.normal - (format "If given a name without a module prefix, gives it the current module's name as prefix." - \n "Otherwise, returns the name as-is.") - [(normal name)]) + ($.documentation /.current_module + "The module currently being compiled, if any.") -(documentation: /.macro - "Looks-up a macro known by the given name." - [(macro full_name)]) + ($.documentation /.normal + (format "If given a name without a module prefix, gives it the current module's name as prefix." + \n "Otherwise, returns the name as-is.") + [(normal name)]) -(documentation: /.seed - (format "The current value of a number tracked by the compiler." - \n "Also increases the value, so it's different next time it is seen." - \n "This number can be used for generating data 'randomly' during compilation.")) + ($.documentation /.macro + "Looks-up a macro known by the given name." + [(macro full_name)]) -(documentation: /.module_exists? - "" - [(module_exists? module)]) + ($.documentation /.seed + (format "The current value of a number tracked by the compiler." + \n "Also increases the value, so it's different next time it is seen." + \n "This number can be used for generating data 'randomly' during compilation.")) -(documentation: /.var_type - "Looks-up the type of a local variable somewhere in the environment." - [(var_type name)]) + ($.documentation /.module_exists? + "" + [(module_exists? module)]) -(documentation: /.definition - "Looks-up a definition's whole data in the available modules (including the current one)." - [(definition name)]) + ($.documentation /.var_type + "Looks-up the type of a local variable somewhere in the environment." + [(var_type name)]) -(documentation: /.export - (format "Looks-up a definition in the available modules (including the current one)." - \n "The look-up only succeeds if the definition has been exported.") - [(export name)]) + ($.documentation /.definition + "Looks-up a definition's whole data in the available modules (including the current one)." + [(definition name)]) -(documentation: /.definition_type - "Looks-up a definition's type in the available modules (including the current one)." - [(definition_type name)]) + ($.documentation /.export + (format "Looks-up a definition in the available modules (including the current one)." + \n "The look-up only succeeds if the definition has been exported.") + [(export name)]) -(documentation: /.type - "Looks-up the type of either a local variable or a definition." - [(type name)]) + ($.documentation /.definition_type + "Looks-up a definition's type in the available modules (including the current one)." + [(definition_type name)]) -(documentation: /.type_definition - "Finds the value of a type definition (such as Int, Any or Lux)." - [(type_definition name)]) + ($.documentation /.type + "Looks-up the type of either a local variable or a definition." + [(type name)]) -(documentation: /.globals - "The entire list of globals in a module (including the non-exported/private ones)." - [(globals module)]) + ($.documentation /.type_definition + "Finds the value of a type definition (such as Int, Any or Lux)." + [(type_definition name)]) -(documentation: /.definitions - "The entire list of definitions in a module (including the non-exported/private ones)." - [(definitions module)]) + ($.documentation /.globals + "The entire list of globals in a module (including the non-exported/private ones)." + [(globals module)]) -(documentation: /.exports - "All the exported definitions in a module." - [(exports module_name)]) + ($.documentation /.definitions + "The entire list of definitions in a module (including the non-exported/private ones)." + [(definitions module)]) -(documentation: /.modules - "All the available modules (including the current one).") + ($.documentation /.exports + "All the exported definitions in a module." + [(exports module_name)]) -(documentation: /.tags_of - "All the tags associated with a type definition." - [(tags_of type_name)]) + ($.documentation /.modules + "All the available modules (including the current one).") -(documentation: /.location - "The location of the current expression being analyzed.") + ($.documentation /.tags_of + "All the tags associated with a type definition." + [(tags_of type_name)]) -(documentation: /.expected_type - "The expected type of the current expression being analyzed.") + ($.documentation /.location + "The location of the current expression being analyzed.") -(documentation: /.imported_modules - "All the modules imported by a specified module." - [(imported_modules module_name)]) + ($.documentation /.expected_type + "The expected type of the current expression being analyzed.") -(documentation: /.imported_by? - "" - [(imported_by? import module)]) + ($.documentation /.imported_modules + "All the modules imported by a specified module." + [(imported_modules module_name)]) -(documentation: /.imported? - "Checks if the given module has been imported by the current module." - [(imported? import)]) + ($.documentation /.imported_by? + "" + [(imported_by? import module)]) -(documentation: /.tag - "Given a tag, finds out what is its index, its related tag-list and its associated type." - [(tag tag_name)]) + ($.documentation /.imported? + "Checks if the given module has been imported by the current module." + [(imported? import)]) -(documentation: /.slot - "Given a slot, finds out what is its index, its related slot-list and its associated type." - [(slot slot_name)]) + ($.documentation /.tag + "Given a tag, finds out what is its index, its related tag-list and its associated type." + [(tag tag_name)]) -(documentation: /.tag_lists - "All the tag-lists defined in a module, with their associated types." - [(tag_lists module)]) + ($.documentation /.slot + "Given a slot, finds out what is its index, its related slot-list and its associated type." + [(slot slot_name)]) -(documentation: /.locals - "All the local variables currently in scope, separated in different scopes.") + ($.documentation /.tag_lists + "All the tag-lists defined in a module, with their associated types." + [(tag_lists module)]) -(documentation: /.de_aliased - "Given an aliased definition's name, returns the original definition being referenced." - [(de_aliased def_name)]) + ($.documentation /.locals + "All the local variables currently in scope, separated in different scopes.") -(documentation: /.compiler_state - "Obtains the current state of the compiler.") + ($.documentation /.de_aliased + "Given an aliased definition's name, returns the original definition being referenced." + [(de_aliased def_name)]) -(documentation: /.type_context - "The current type-checking context.") + ($.documentation /.compiler_state + "Obtains the current state of the compiler.") -(documentation: /.eval - "" - [(eval type code)]) + ($.documentation /.type_context + "The current type-checking context.") -(.def .public documentation - (.List $.Module) - ($.module /._ - "Functions for extracting information from the state of the compiler." - [..result' - ..result - ..either - ..assertion - ..failure - ..module - ..current_module_name - ..current_module - ..normal - ..macro - ..seed - ..module_exists? - ..var_type - ..definition - ..export - ..definition_type - ..type - ..type_definition - ..globals - ..definitions - ..exports - ..modules - ..tags_of - ..location - ..expected_type - ..imported_modules - ..imported_by? - ..imported? - ..tag - ..slot - ..tag_lists - ..locals - ..de_aliased - ..compiler_state - ..type_context - ..eval - ($.default /.functor) - ($.default /.apply) - ($.default /.monad) - ($.default /.lifted) - ($.default /.try)] + ($.documentation /.eval + "" + [(eval type code)])] [/location.documentation /symbol.documentation])) diff --git a/stdlib/source/documentation/lux/meta/location.lux b/stdlib/source/documentation/lux/meta/location.lux index d7a7ad1eb..0d3bcaf84 100644 --- a/stdlib/source/documentation/lux/meta/location.lux +++ b/stdlib/source/documentation/lux/meta/location.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except private) - ["$" documentation (.only documentation:)] + ["$" documentation] [data ["[0]" text (.only \n) ["%" \\format (.only format)]]] @@ -10,21 +10,19 @@ [\\library ["[0]" /]]) -(documentation: /.here - "The Location of the current form." - [(here)]) - -(documentation: /.with - "" - [(with location error)]) - (.def .public documentation (.List $.Module) ($.module /._ "" - [..here - ..with - ($.default /.equivalence) + [($.default /.equivalence) ($.default /.dummy) - ($.default /.format)] + ($.default /.format) + + ($.documentation /.here + "The Location of the current form." + [(here)]) + + ($.documentation /.with + "" + [(with location error)])] [])) diff --git a/stdlib/source/documentation/lux/meta/symbol.lux b/stdlib/source/documentation/lux/meta/symbol.lux index 6bdb746c3..8189cdf71 100644 --- a/stdlib/source/documentation/lux/meta/symbol.lux +++ b/stdlib/source/documentation/lux/meta/symbol.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]]] @@ -10,20 +10,18 @@ [\\library ["[0]" /]]) -(documentation: /.module - "The module part of a symbol.") - -(documentation: /.short - "The short part of a symbol.") - (.def .public documentation (.List $.Module) ($.module /._ "" - [..module - ..short - ($.default /.hash) + [($.default /.hash) ($.default /.equivalence) ($.default /.order) - ($.default /.codec)] + ($.default /.codec) + + ($.documentation /.module + "The module part of a symbol.") + + ($.documentation /.short + "The short part of a symbol.")] [])) |