From bf53ee92fc3c33a4885aa227e55d24f7ba3cb2c4 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 16 Mar 2022 08:37:23 -0400 Subject: De-sigil-ification: prefix : --- stdlib/source/documentation/lux.lux | 146 +++++++++++++++++------------------- 1 file changed, 70 insertions(+), 76 deletions(-) (limited to 'stdlib/source/documentation/lux.lux') diff --git a/stdlib/source/documentation/lux.lux b/stdlib/source/documentation/lux.lux index bbefd85a6..823f6efc4 100644 --- a/stdlib/source/documentation/lux.lux +++ b/stdlib/source/documentation/lux.lux @@ -172,15 +172,15 @@ (documentation: /.list "List literals." - [(: (List Nat) - (list 0 1 2 3))]) + [(is (List Nat) + (list 0 1 2 3))]) (documentation: /.list& "List literals, with the last element being a tail-list." - [(: (List Nat) - (list& 0 1 2 3 - (: (List Nat) - (list 4 5 6))))]) + [(is (List Nat) + (list& 0 1 2 3 + (is (List Nat) + (list 4 5 6))))]) (documentation: /.Union "Union types." @@ -307,15 +307,15 @@ [(type (All (_ a) (Maybe (List a))))]) -(documentation: /.: +(documentation: /.is "The type-annotation macro." - [(: (List Int) - (list +1 +2 +3))]) + [(is (List Int) + (list +1 +2 +3))]) -(documentation: /.:as +(documentation: /.as "The type-coercion macro." - [(:as Dinosaur - (list +1 +2 +3))]) + [(as Dinosaur + (list +1 +2 +3))]) (documentation: /.Rec "Parameter-less recursive types." @@ -350,8 +350,8 @@ (documentation: /.case (format "The pattern-matching macro." \n "Allows the usage of macros within the patterns to provide custom syntax.") - [(case (: (List Int) - (list +1 +2 +3)) + [(case (is (List Int) + (list +1 +2 +3)) {#Item x {#Item y {#Item z {#End}}}} {#Some ($_ * x y z)} @@ -361,8 +361,8 @@ (documentation: /.pattern (format "Macro-expanding patterns." \n "It's a special macro meant to be used with 'case'.") - [(case (: (List Int) - (list +1 +2 +3)) + [(case (is (List Int) + (list +1 +2 +3)) (pattern (list x y z)) {#Some ($_ * x y z)} @@ -400,16 +400,16 @@ (documentation: /.function "Syntax for creating functions." - [(: (All (_ a b) - (-> a b a)) - (function (_ x y) - x))] + [(is (All (_ a b) + (-> a b a)) + (function (_ x y) + x))] ["Allows for giving the function itself a name, for the sake of recursion." - (: (-> Nat Nat) - (function (factorial n) - (case n - 0 1 - _ (* n (factorial (-- n))))))]) + (is (-> Nat Nat) + (function (factorial n) + (case n + 0 1 + _ (* n (factorial (-- n))))))]) (documentation: /.def: "Defines global constants/functions." @@ -464,13 +464,13 @@ (documentation: /.implementation "Express a value that implements an interface." - [(: (Order Int) - (implementation - (def: &equivalence - equivalence) - (def: (< reference subject) - (< reference subject)) - ))]) + [(is (Order Int) + (implementation + (def: &equivalence + equivalence) + (def: (< reference subject) + (< reference subject)) + ))]) (documentation: /.implementation: "Interface implementation." @@ -510,10 +510,10 @@ "Interface definition." [(type: .public (Order a) (Interface - (: (Equivalence a) - &equivalence) - (: (-> a a Bit) - <)))]) + (is (Equivalence a) + &equivalence) + (is (-> a a Bit) + <)))]) (.template [] [(documentation: @@ -765,15 +765,15 @@ "=>" ["documentation/lux" "#doc"]]) -(documentation: /.:parameter +(documentation: /.parameter (format "WARNING: Please stay away from this macro; it's very likely to be removed in a future version of Lux." "Allows you to refer to the type-variables in a polymorphic function's type, by their index.") ["In the example below, 0 corresponds to the 'a' variable." (def: .public (of_list list) (All (_ a) (-> (List a) (Sequence a))) (list#mix add - (: (Sequence (:parameter 0)) - empty) + (is (Sequence (parameter 0)) + empty) list))]) (documentation: /.same? @@ -801,11 +801,11 @@ (^|> value [++ (% 10) (max 1)]) (foo value))]) -(documentation: /.:expected +(documentation: /.as_expected "Coerces the given expression to the type of whatever is expected." - [(: Dinosaur - (:expected (: (List Nat) - (list 1 2 3))))]) + [(is Dinosaur + (as_expected (is (List Nat) + (list 1 2 3))))]) (documentation: /.undefined (format "Meant to be used as a stand-in for functions with undefined implementations." @@ -815,13 +815,13 @@ (-> Int Int) (undefined))]) -(documentation: /.:of +(documentation: /.type_of "Generates the type corresponding to a given expression." [(let [my_num +123] - (:of my_num)) + (type_of my_num)) "==" Int] - [(:of +123) + [(type_of +123) "==" Int]) @@ -842,8 +842,8 @@ (documentation: /.char "If given a 1-character text literal, yields the char-code of the sole character." - [(: Nat - (char "A")) + [(is Nat + (char "A")) "=>" 65]) @@ -865,13 +865,13 @@ (documentation: /.^code "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} + [(is (Maybe Nat) + (case (` (#0 123 +456.789)) + (^code (#0 (~ [_ {.#Nat number}]) +456.789)) + {.#Some number} - _ - {.#None}))]) + _ + {.#None}))]) (documentation: /.false "The boolean FALSE value.") @@ -879,24 +879,19 @@ (documentation: /.true "The boolean TRUE value.") -(documentation: /.:let - "Local bindings for types." - [(:let [side (Either Int Frac)] - (List [side side]))]) - (documentation: /.try "" - [(: Foo - (case (: (Either Text Bar) - (try (: Bar - (risky computation which may panic)))) - {.#Right success} - (: Foo - (do something after success)) - - {.#Left error} - (: Foo - (recover from error))))]) + [(is Foo + (case (is (Either Text Bar) + (try (is Bar + (risky computation which may panic)))) + {.#Right success} + (is Foo + (do something after success)) + + {.#Left error} + (is Foo + (recover from error))))]) (.def: .public documentation (.List $.Module) @@ -954,8 +949,8 @@ ..template ..not ..type - ..: - ..:as + ..is + ..as ..Rec ..exec ..case @@ -997,13 +992,13 @@ ..static ..^multi ..symbol - ..:parameter + ..parameter ..same? ..^let ..^|> - ..:expected + ..as_expected ..undefined - ..:of + ..type_of ..template: ..as_is ..char @@ -1012,7 +1007,6 @@ ..^code ..false ..true - ..:let ..try ($.default (/.Code' w)) ($.default /.Alias) -- cgit v1.2.3