diff options
author | Eduardo Julian | 2021-09-12 00:07:08 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-09-12 00:07:08 -0400 |
commit | dda05bca0956af5e5b3875c4cc36e61aa04772e4 (patch) | |
tree | 0f8b27697d58ab5c8e41aba7c7c9f769d3800767 /stdlib/source/documentation | |
parent | d48270f43c404ba19ca04da2553455ecaaf2caba (diff) |
Made the "#" character great again!
Diffstat (limited to 'stdlib/source/documentation')
11 files changed, 64 insertions, 65 deletions
diff --git a/stdlib/source/documentation/lux.lux b/stdlib/source/documentation/lux.lux index 0f6e94998..cf7137856 100644 --- a/stdlib/source/documentation/lux.lux +++ b/stdlib/source/documentation/lux.lux @@ -354,11 +354,11 @@ \n "Allows the usage of macros within the patterns to provide custom syntax.") [(case (: (List Int) (list +1 +2 +3)) - {#Item x {#Item y {#Item z #End}}} + {#Item x {#Item y {#Item z {#End}}}} {#Some ($_ * x y z)} _ - #None)]) + {#None})]) (documentation: /.^ (format "Macro-expanding patterns." @@ -369,25 +369,25 @@ {#Some ($_ * x y z)} _ - #None)]) + {#None})]) (documentation: /.^or (format "Or-patterns." \n "It's a special macro meant to be used with 'case'.") [(type: Weekday (Variant - #Monday - #Tuesday - #Wednesday - #Thursday - #Friday - #Saturday - #Sunday)) + {#Monday} + {#Tuesday} + {#Wednesday} + {#Thursday} + {#Friday} + {#Saturday} + {#Sunday})) (def: (weekend? day) (-> Weekday Bit) (case day - (^or #Saturday #Sunday) + (^or {#Saturday} {#Sunday}) #1 _ @@ -488,11 +488,11 @@ \n "WARNING: Only use it within the type: macro.") [(type: Referrals (Variant - #All + {#All} {#Only (List Text)} {#Exclude (List Text)} - #Ignore - #Nothing))]) + {#Ignore} + {#Nothing}))]) (documentation: /.Record (format "Syntax for defining labelled/slotted product/tuple types." @@ -505,7 +505,7 @@ (documentation: /.type: "The type-definition macro." [(type: (List a) - #End + {#End} {#Item a (List a)})]) (documentation: /.Interface @@ -538,15 +538,15 @@ (All (_ a) (-> (Enum a) a a (List a))) (let [(^open "[0]") enum] (loop [end to - output #.End] + output {.#End}] (cond (< end from) - (recur (pred end) {#.Item end output}) + (recur (pred end) {.#Item end output}) (< from end) - (recur (succ end) {#.Item end output}) + (recur (succ end) {.#Item end output}) ... (= end from) - {#.Item end output}))))]) + {.#Item end output}))))]) (documentation: /.cond "Conditional branching with multiple test conditions." @@ -640,30 +640,30 @@ [(def: (reduced env type) (-> (List Type) Type Type) (case type - {#.Primitive name params} - {#.Primitive name (list\each (reduced env) params)} + {.#Primitive name params} + {.#Primitive name (list\each (reduced env) params)} (^template [<tag>] [{<tag> left right} {<tag> (reduced env left) (reduced env right)}]) - ([#.Sum] [#.Product]) + ([.#Sum] [.#Product]) (^template [<tag>] [{<tag> left right} {<tag> (reduced env left) (reduced env right)}]) - ([#.Function] [#.Apply]) + ([.#Function] [.#Apply]) (^template [<tag>] [{<tag> old_env def} (case old_env - #.End + {.#End} {<tag> env def} _ type)]) - ([#.UnivQ] [#.ExQ]) + ([.#UnivQ] [.#ExQ]) - {#.Parameter idx} + {.#Parameter idx} (else type (list.item idx env)) _ @@ -715,7 +715,6 @@ [int +123 "+123"] [frac +123.0 "+123.0"] [text "123" "'123'"] - [tag ["yolo" "lol"] "#yolo.lol"] [identifier ["yolo" "lol"] "yolo.lol"] [form (list (bit #1)) "(#1)"] [tuple (list (bit #1)) "[#1]"] @@ -769,9 +768,9 @@ (documentation: /.name_of "Given an identifier or a tag, gives back a 2 tuple with the module and name parts, both as Text." - [(name_of #..doc) + [(name_of ..#doc) "=>" - ["documentation/lux" "doc"]]) + ["documentation/lux" "#doc"]]) (documentation: /.:parameter (format "WARNING: Please stay away from this macro; it's very likely to be removed in a future version of Lux." @@ -875,11 +874,11 @@ "Generates pattern-matching code for Code values in a way that looks like code-templating." [(: (Maybe Nat) (case (` (#0 123 +456.789)) - (^code (#0 (~ [_ {#.Nat number}]) +456.789)) - {#.Some number} + (^code (#0 (~ [_ {.#Nat number}]) +456.789)) + {.#Some number} _ - #.None))]) + {.#None}))]) (documentation: /.false "The boolean FALSE value.") @@ -898,11 +897,11 @@ (case (: (Either Text Bar) (try (: Bar (risky computation which may panic)))) - {#.Right success} + {.#Right success} (: Foo (do something after success)) - {#.Left error} + {.#Left error} (: Foo (recover from error))))]) diff --git a/stdlib/source/documentation/lux/control/concurrency/actor.lux b/stdlib/source/documentation/lux/control/concurrency/actor.lux index 1727f3c5f..a030eabaf 100644 --- a/stdlib/source/documentation/lux/control/concurrency/actor.lux +++ b/stdlib/source/documentation/lux/control/concurrency/actor.lux @@ -58,8 +58,8 @@ (message: .public (push [value a] state self) (List a) - (let [state' {#.Item value state}] - (async.resolved {#try.Success [state' state']})))) + (let [state' {.#Item value state}] + (async.resolved {try.#Success [state' state']})))) (actor: .public counter Nat @@ -67,11 +67,11 @@ (message: .public (count! [increment Nat] state self) Any (let [state' (n.+ increment state)] - (async.resolved {#try.Success [state' state']}))) + (async.resolved {try.#Success [state' state']}))) (message: .public (read! state self) Nat - (async.resolved {#try.Success [state state]}))))] + (async.resolved {try.#Success [state state]}))))] (documentation: /.actor: (format "Defines a named actor, with its behavior and internal state." \n "Messages for the actor must be defined after the on_mail handler.") diff --git a/stdlib/source/documentation/lux/control/maybe.lux b/stdlib/source/documentation/lux/control/maybe.lux index 582c1fa4a..6af1e40d8 100644 --- a/stdlib/source/documentation/lux/control/maybe.lux +++ b/stdlib/source/documentation/lux/control/maybe.lux @@ -16,17 +16,17 @@ (documentation: /.else (format "Allows you to provide a default value that will be used" - \n "if a (Maybe x) value turns out to be #.None." + \n "if a (Maybe x) value turns out to be .#None." \n "Note: the expression for the default value will not be computed if the base computation succeeds.") - [(else +20 {#.Some +10}) + [(else +20 {.#Some +10}) "=>" +10] - [(else +20 #.None) + [(else +20 {.#None}) "=>" +20]) (documentation: /.trusted - (format "Assumes that a Maybe value is a #.Some and yields its value." + (format "Assumes that a Maybe value is a .#Some and yields its value." \n "Raises/throws a runtime error otherwise." \n "WARNING: Use with caution.") [(trusted trusted_computation)]) diff --git a/stdlib/source/documentation/lux/control/try.lux b/stdlib/source/documentation/lux/control/try.lux index 8176614d0..ed5b8dc5d 100644 --- a/stdlib/source/documentation/lux/control/try.lux +++ b/stdlib/source/documentation/lux/control/try.lux @@ -40,9 +40,9 @@ \n "if a (Try x) value turns out to be #Failure." \n "Note: the expression for the default value will not be computed if the base computation succeeds.") [(= "bar" - (else "foo" {#..Success "bar"}))] + (else "foo" {/.#Success "bar"}))] [(= "foo" - (else "foo" {#..Failure "KABOOM!"}))]) + (else "foo" {/.#Failure "KABOOM!"}))]) (.def: .public documentation (.List $.Module) diff --git a/stdlib/source/documentation/lux/data/collection/array.lux b/stdlib/source/documentation/lux/data/collection/array.lux index b8926391a..91f017509 100644 --- a/stdlib/source/documentation/lux/data/collection/array.lux +++ b/stdlib/source/documentation/lux/data/collection/array.lux @@ -86,8 +86,8 @@ (documentation: /.list (format "Yields a list with every non-empty item in the array." \n "Can use the optional default value when encountering an empty cell in the array.") - [(list #.None array) - (list {#.Some default} array)]) + [(list {.#None} array) + (list {.#Some default} array)]) (.def: .public documentation (.List $.Module) diff --git a/stdlib/source/documentation/lux/data/collection/list.lux b/stdlib/source/documentation/lux/data/collection/list.lux index 1c183591e..fa3ca1a09 100644 --- a/stdlib/source/documentation/lux/data/collection/list.lux +++ b/stdlib/source/documentation/lux/data/collection/list.lux @@ -53,7 +53,7 @@ [(repeated n x)]) (documentation: /.iterations - "Generates a list element by element until the function returns #.None." + "Generates a list element by element until the function returns .#None." [(iterations f x)]) (documentation: /.one @@ -124,7 +124,7 @@ (documentation: /.inits (format "For a list of size N, yields the first N-1 elements." - \n "Will yield a #.None for empty lists.") + \n "Will yield a .#None for empty lists.") [(inits xs)]) (documentation: /.together diff --git a/stdlib/source/documentation/lux/extension.lux b/stdlib/source/documentation/lux/extension.lux index 5d0e64f51..0172abaf7 100644 --- a/stdlib/source/documentation/lux/extension.lux +++ b/stdlib/source/documentation/lux/extension.lux @@ -39,7 +39,7 @@ "" [(generation: ("my generation" self phase archive [pass_through <synthesis>.any]) (for [@.jvm - (\ phase.monad each (|>> #jvm.Embedded + (\ phase.monad each (|>> {jvm.#Embedded} row.row) (phase archive pass_through))] (phase archive pass_through)))]) diff --git a/stdlib/source/documentation/lux/ffi.jvm.lux b/stdlib/source/documentation/lux/ffi.jvm.lux index d8e818783..c4f401f2e 100644 --- a/stdlib/source/documentation/lux/ffi.jvm.lux +++ b/stdlib/source/documentation/lux/ffi.jvm.lux @@ -142,13 +142,13 @@ (documentation: /.??? "Takes a (potentially null) ObjectType reference and creates a (Maybe ObjectType) for it." [(= (??? (: java/lang/String (null))) - #.None)] + {.#None})] [(= (??? "YOLO") - {#.Some "YOLO"})]) + {.#Some "YOLO"})]) (documentation: /.!!! (format "Takes a (Maybe ObjectType) and returns a ObjectType." - \n "A #.None would get translated into a (null).") + \n "A .#None would get translated into a (null).") [(= (null) (!!! (??? (: java/lang/Thread (null)))))] [(= "foo" @@ -158,8 +158,8 @@ (format "Checks whether an object is an instance of a particular class." \n "Caveat emptor: Cannot check for polymorphism, so avoid using parameterized classes.") [(case (check String "YOLO") - {#.Some value_as_string} - #.None)]) + {.#Some value_as_string} + {.#None})]) (documentation: /.synchronized "Evaluates body, while holding a lock on a given object." @@ -184,7 +184,7 @@ (equals [java/lang/Object] boolean) (wait [int] "io" "try" void)])] ["Special options can also be given for the return values." - "'?' means that the values will be returned inside a Maybe type. That way, null becomes #.None." + "'?' means that the values will be returned inside a Maybe type. That way, null becomes .#None." "'try' means that the computation might throw an exception, and the return value will be wrapped by the Try type." "'io' means the computation has side effects, and will be wrapped by the IO type." "These options must show up in the following order ['io' 'try' '?'] (although, each option can be used independently)." diff --git a/stdlib/source/documentation/lux/ffi.old.lux b/stdlib/source/documentation/lux/ffi.old.lux index 64fbfcf45..f45b2df01 100644 --- a/stdlib/source/documentation/lux/ffi.old.lux +++ b/stdlib/source/documentation/lux/ffi.old.lux @@ -105,15 +105,15 @@ (documentation: /.??? "Takes a (potentially null) ObjectType reference and creates a (Maybe ObjectType) for it." [(= (??? (: java/lang/String (null))) - #.None)] + {.#None})] [(= (??? "YOLO") - {#.Some "YOLO"})]) + {.#Some "YOLO"})]) (documentation: /.!!! "Takes a (Maybe ObjectType) and returns a ObjectType." [(= "foo" (!!! (??? "foo")))] - ["A #.None would get translated into a (null)." + ["A .#None would get translated into a (null)." (= (null) (!!! (??? (: java/lang/Thread (null)))))]) @@ -121,8 +121,8 @@ (format "Checks whether an object is an instance of a particular class." \n "Caveat emptor: Cannot check for polymorphism, so avoid using parameterized classes.") [(case (check java/lang/String "YOLO") - {#.Some value_as_string} - #.None)]) + {.#Some value_as_string} + {.#None})]) (documentation: /.synchronized "Evaluates body, while holding a lock on a given object." @@ -147,7 +147,7 @@ (equals [java/lang/Object] boolean) (wait [int] "io" "try" void)])] ["Special options can also be given for the return values." - "'?' means that the values will be returned inside a Maybe type. That way, null becomes #.None." + "'?' means that the values will be returned inside a Maybe type. That way, null becomes .#None." "'try' means that the computation might throw an exception, and the return value will be wrapped by the Try type." "'io' means the computation has side effects, and will be wrapped by the IO type." "These options must show up in the following order ['io' 'try' '?'] (although, each option can be used independently)." diff --git a/stdlib/source/documentation/lux/type/unit.lux b/stdlib/source/documentation/lux/type/unit.lux index fdf8e27d6..667c9901f 100644 --- a/stdlib/source/documentation/lux/type/unit.lux +++ b/stdlib/source/documentation/lux/type/unit.lux @@ -44,8 +44,8 @@ (template [<type> <scale>] [(`` (documentation: <scale> - (let [numerator (value@ [#/.ratio #ratio.numerator] <scale>) - denominator (value@ [#/.ratio #ratio.denominator] <scale>)] + (let [numerator (value@ [/.#ratio ratio.#numerator] <scale>) + denominator (value@ [/.#ratio ratio.#denominator] <scale>)] (format "The '" (~~ (template.text [<scale>])) "' scale, from " (%.nat numerator) " to " (%.nat denominator) "."))))] [/.Kilo /.kilo] diff --git a/stdlib/source/documentation/lux/world/output/video/resolution.lux b/stdlib/source/documentation/lux/world/output/video/resolution.lux index e66d2a226..808bc1a42 100644 --- a/stdlib/source/documentation/lux/world/output/video/resolution.lux +++ b/stdlib/source/documentation/lux/world/output/video/resolution.lux @@ -23,8 +23,8 @@ (text.replaced "_" " ") text.upper_cased)] (format name " resolution: " - (%.nat (value@ #/.width <name>)) - "x" (%.nat (value@ #/.height <name>)) + (%.nat (value@ /.#width <name>)) + "x" (%.nat (value@ /.#height <name>)) ".")))] [/.svga] |