aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/source/lux/concurrency/actor.lux10
-rw-r--r--stdlib/source/lux/control/exception.lux4
-rw-r--r--stdlib/source/lux/control/region.lux4
-rw-r--r--stdlib/source/lux/data/coll/tree/rose/parser.lux4
-rw-r--r--stdlib/source/lux/data/format/context.lux4
-rw-r--r--stdlib/source/lux/data/format/xml.lux34
-rw-r--r--stdlib/source/lux/lang/syntax.lux8
-rw-r--r--stdlib/source/lux/lang/type/check.lux30
-rw-r--r--stdlib/source/lux/macro/poly.lux4
-rw-r--r--stdlib/source/lux/math/constructive.lux4
-rw-r--r--stdlib/source/lux/math/modular.lux12
-rw-r--r--stdlib/source/lux/type/resource.lux8
-rw-r--r--stdlib/source/lux/world/blob.jvm.lux24
-rw-r--r--stdlib/source/lux/world/file.lux8
-rw-r--r--stdlib/source/lux/world/net/udp.jvm.lux8
-rw-r--r--stdlib/test/test/lux/concurrency/actor.lux2
-rw-r--r--stdlib/test/test/lux/control/exception.lux16
-rw-r--r--stdlib/test/test/lux/control/region.lux6
18 files changed, 95 insertions, 95 deletions
diff --git a/stdlib/source/lux/concurrency/actor.lux b/stdlib/source/lux/concurrency/actor.lux
index ed62332a8..a50b7a046 100644
--- a/stdlib/source/lux/concurrency/actor.lux
+++ b/stdlib/source/lux/concurrency/actor.lux
@@ -19,9 +19,9 @@
[promise #+ Promise promise "promise/" Monad<Promise>]
[task #+ Task]))
-(exception: #export Poisoned)
+(exception: #export poisoned)
-(exception: #export (Dead {actor-name Text}
+(exception: #export (dead {actor-name Text}
{message-name Text})
(format " Actor: " actor-name "\n"
"Message: " message-name "\n"))
@@ -137,7 +137,7 @@
but allows the actor to handle previous messages."}
(All [s] (-> (Actor s) (IO Bool)))
(send (function (_ state self)
- (task.throw Poisoned []))
+ (task.throw poisoned []))
actor))
## [Syntax]
@@ -206,7 +206,7 @@
((stop cause state)
(:: promise.Monad<Promise> wrap
- (log! (if (ex.match? ..Poisoned cause)
+ (log! (if (ex.match? ..poisoned cause)
(format "Counter was poisoned: " (%n state))
cause)))))
@@ -363,7 +363,7 @@
(~ g!self))]
(if (~ g!sent?)
((~' wrap) (~ g!task))
- ((~' wrap) (task.throw ..Dead [(~ (code.text (%ident actor-name)))
+ ((~' wrap) (task.throw ..dead [(~ (code.text (%ident actor-name)))
(~ (code.text (%ident message-name)))]))))))))
))
)))
diff --git a/stdlib/source/lux/control/exception.lux b/stdlib/source/lux/control/exception.lux
index 2b5c40713..c3fc94277 100644
--- a/stdlib/source/lux/control/exception.lux
+++ b/stdlib/source/lux/control/exception.lux
@@ -79,10 +79,10 @@
"It moslty just serves as a way to tag error messages for later catching."
""
"Simple case:"
- (exception: #export Some-Exception)
+ (exception: #export some-exception)
""
"Complex case:"
- (exception: #export [optional type-vars] (Some-Exception [optional Text] {arguments Int})
+ (exception: #export [optional type-vars] (some-exception [optional Text] {arguments Int})
optional-body))}
(macro.with-gensyms [g!descriptor]
(do @
diff --git a/stdlib/source/lux/control/region.lux b/stdlib/source/lux/control/region.lux
index 3729c00f2..f21076ad0 100644
--- a/stdlib/source/lux/control/region.lux
+++ b/stdlib/source/lux/control/region.lux
@@ -24,7 +24,7 @@
"-----------------------------------------\n"
"\n"))
-(exception: #export [a] (Clean-Up-Error {error Text}
+(exception: #export [a] (clean-up-error {error Text}
{output (Error a)})
(format error
(case output
@@ -42,7 +42,7 @@
output
(#e.Error error|clean-up)
- (ex.throw Clean-Up-Error [error|clean-up output])))
+ (ex.throw clean-up-error [error|clean-up output])))
(def: #export (run Monad<m> computation)
(All [m a]
diff --git a/stdlib/source/lux/data/coll/tree/rose/parser.lux b/stdlib/source/lux/data/coll/tree/rose/parser.lux
index bee1e07f9..3e3535649 100644
--- a/stdlib/source/lux/data/coll/tree/rose/parser.lux
+++ b/stdlib/source/lux/data/coll/tree/rose/parser.lux
@@ -27,7 +27,7 @@
(function (_ zipper)
(#E.Success [zipper (zipper.value zipper)])))
-(exception: #export Cannot-Move-Further)
+(exception: #export cannot-move-further)
(do-template [<name> <direction>]
[(def: #export <name>
@@ -35,7 +35,7 @@
(function (_ zipper)
(let [next (<direction> zipper)]
(if (is? zipper next)
- (ex.throw Cannot-Move-Further [])
+ (ex.throw cannot-move-further [])
(#E.Success [next []])))))]
[up zipper.up]
diff --git a/stdlib/source/lux/data/format/context.lux b/stdlib/source/lux/data/format/context.lux
index 1810a66a2..e84e29026 100644
--- a/stdlib/source/lux/data/format/context.lux
+++ b/stdlib/source/lux/data/format/context.lux
@@ -6,7 +6,7 @@
(data ["E" error]
(coll (dictionary ["dict" unordered #+ Dict])))))
-(exception: #export (Unknown-Property {property Text})
+(exception: #export (unknown-property {property Text})
property)
(type: #export Context
@@ -23,7 +23,7 @@
(ex.return [context value])
#.None
- (ex.throw Unknown-Property name))))
+ (ex.throw unknown-property name))))
(def: #export (run context property)
(All [a] (-> Context (Property a) (E.Error a)))
diff --git a/stdlib/source/lux/data/format/xml.lux b/stdlib/source/lux/data/format/xml.lux
index 06b4b3994..23b12a42d 100644
--- a/stdlib/source/lux/data/format/xml.lux
+++ b/stdlib/source/lux/data/format/xml.lux
@@ -245,14 +245,14 @@
(type: #export (Reader a)
(p.Parser (List XML) a))
-(exception: #export Empty-Input)
-(exception: #export Unexpected-Input)
-(exception: #export Unknown-Attribute)
+(exception: #export empty-input)
+(exception: #export unexpected-input)
+(exception: #export unknown-attribute)
-(exception: #export (Wrong-Tag {tag Ident})
+(exception: #export (wrong-tag {tag Ident})
(ident/encode tag))
-(exception: #export (Unconsumed-Inputs {inputs (List XML)})
+(exception: #export (unconsumed-inputs {inputs (List XML)})
(|> inputs
(list/map (:: Codec<Text,XML> encode))
(text.join-with "\n\n")))
@@ -262,7 +262,7 @@
(function (_ docs)
(case docs
#.Nil
- (ex.throw Empty-Input [])
+ (ex.throw empty-input [])
(#.Cons head tail)
(case head
@@ -270,24 +270,24 @@
(#E.Success [tail value])
(#Node _)
- (ex.throw Unexpected-Input [])))))
+ (ex.throw unexpected-input [])))))
(def: #export (attr name)
(-> Ident (Reader Text))
(function (_ docs)
(case docs
#.Nil
- (ex.throw Empty-Input [])
+ (ex.throw empty-input [])
(#.Cons head _)
(case head
(#Text _)
- (ex.throw Unexpected-Input [])
+ (ex.throw unexpected-input [])
(#Node tag attrs children)
(case (d.get name attrs)
#.None
- (ex.throw Unknown-Attribute [])
+ (ex.throw unknown-attribute [])
(#.Some value)
(#E.Success [docs value]))))))
@@ -298,7 +298,7 @@
(#E.Success [remaining output])
(if (list.empty? remaining)
(#E.Success output)
- (ex.throw Unconsumed-Inputs remaining))
+ (ex.throw unconsumed-inputs remaining))
(#E.Error error)
(#E.Error error)))
@@ -308,29 +308,29 @@
(function (_ docs)
(case docs
#.Nil
- (ex.throw Empty-Input [])
+ (ex.throw empty-input [])
(#.Cons head _)
(case head
(#Text _)
- (ex.throw Unexpected-Input [])
+ (ex.throw unexpected-input [])
(#Node _tag _attrs _children)
(if (ident/= tag _tag)
(#E.Success [docs []])
- (ex.throw Wrong-Tag tag))))))
+ (ex.throw wrong-tag tag))))))
(def: #export (children reader)
(All [a] (-> (Reader a) (Reader a)))
(function (_ docs)
(case docs
#.Nil
- (ex.throw Empty-Input [])
+ (ex.throw empty-input [])
(#.Cons head tail)
(case head
(#Text _)
- (ex.throw Unexpected-Input [])
+ (ex.throw unexpected-input [])
(#Node _tag _attrs _children)
(do E.Monad<Error>
@@ -342,7 +342,7 @@
(function (_ docs)
(case docs
#.Nil
- (ex.throw Empty-Input [])
+ (ex.throw empty-input [])
(#.Cons head tail)
(#E.Success [tail []]))))
diff --git a/stdlib/source/lux/lang/syntax.lux b/stdlib/source/lux/lang/syntax.lux
index 1296cfaa5..0fefc1929 100644
--- a/stdlib/source/lux/lang/syntax.lux
+++ b/stdlib/source/lux/lang/syntax.lux
@@ -589,10 +589,10 @@
[tag #.Tag (p.after (l.this "#") (ident^ current-module aliases)) +1]
)
-(exception: #export (End-Of-File {module Text})
+(exception: #export (end-of-file {module Text})
module)
-(exception: #export (Unrecognized-Input {[file line column] Cursor})
+(exception: #export (unrecognized-input {[file line column] Cursor})
(format " File: " file "\n"
" Line: " (%n line) "\n"
"Column: " (%n column) "\n"))
@@ -618,8 +618,8 @@
(do @
[end? l.end?]
(if end?
- (p.fail (ex.construct End-Of-File current-module))
- (p.fail (ex.construct Unrecognized-Input where))))
+ (p.fail (ex.construct end-of-file current-module))
+ (p.fail (ex.construct unrecognized-input where))))
)))))
(def: #export (read current-module aliases [where offset source])
diff --git a/stdlib/source/lux/lang/type/check.lux b/stdlib/source/lux/lang/type/check.lux
index 8a32b2c4c..f71ac4150 100644
--- a/stdlib/source/lux/lang/type/check.lux
+++ b/stdlib/source/lux/lang/type/check.lux
@@ -14,22 +14,22 @@
(lang [type "type/" Eq<Type>])
))
-(exception: #export (Unknown-Type-Var {id Nat})
+(exception: #export (unknown-type-var {id Nat})
(nat/encode id))
-(exception: #export (Unbound-Type-Var {id Nat})
+(exception: #export (unbound-type-var {id Nat})
(nat/encode id))
-(exception: #export (Invalid-Type-Application {funcT Type} {argT Type})
+(exception: #export (invalid-type-application {funcT Type} {argT Type})
(type.to-text (#.Apply argT funcT)))
-(exception: #export (Cannot-Rebind-Var {id Nat} {type Type} {bound Type})
+(exception: #export (cannot-rebind-var {id Nat} {type Type} {bound Type})
($_ text/compose
" Var: " (nat/encode id) "\n"
" Wanted Type: " (type.to-text type) "\n"
"Current Type: " (type.to-text bound)))
-(exception: #export (Type-Check-Failed {expected Type} {actual Type})
+(exception: #export (type-check-failed {expected Type} {actual Type})
($_ text/compose
"Expected: " (type.to-text expected) "\n\n"
" Actual: " (type.to-text actual)))
@@ -179,7 +179,7 @@
(#e.Success [context <succeed>])
#.None
- (ex.throw Unknown-Type-Var id))))]
+ (ex.throw unknown-type-var id))))]
[bound? Bool false true]
[read (Maybe Type) #.None (#.Some bound)]
@@ -193,24 +193,24 @@
(#e.Success [context bound])
(#.Some #.None)
- (ex.throw Unbound-Type-Var id)
+ (ex.throw unbound-type-var id)
#.None
- (ex.throw Unknown-Type-Var id))))
+ (ex.throw unknown-type-var id))))
(def: #export (write type id)
(-> Type Var (Check Unit))
(function (_ context)
(case (|> context (get@ #.var-bindings) (var::get id))
(#.Some (#.Some bound))
- (ex.throw Cannot-Rebind-Var [id type bound])
+ (ex.throw cannot-rebind-var [id type bound])
(#.Some #.None)
(#e.Success [(update@ #.var-bindings (var::put id (#.Some type)) context)
[]])
#.None
- (ex.throw Unknown-Type-Var id))))
+ (ex.throw unknown-type-var id))))
(def: (update type id)
(-> Type Var (Check Unit))
@@ -221,7 +221,7 @@
[]])
#.None
- (ex.throw Unknown-Type-Var id))))
+ (ex.throw unknown-type-var id))))
(def: #export var
(Check [Var Type])
@@ -252,7 +252,7 @@
[?funcT' (read func-id)]
(case ?funcT'
#.None
- (throw Invalid-Type-Application [funcT argT])
+ (throw invalid-type-application [funcT argT])
(#.Some funcT')
(apply-type! funcT' argT)))
@@ -261,7 +261,7 @@
(function (_ context)
(case (type.apply (list argT) funcT)
#.None
- (ex.throw Invalid-Type-Application [funcT argT])
+ (ex.throw invalid-type-application [funcT argT])
(#.Some output)
(#e.Success [context output])))))
@@ -290,7 +290,7 @@
(#e.Success [context output])
#.None
- (ex.throw Unknown-Type-Var current)))))
+ (ex.throw unknown-type-var current)))))
(def: #export fresh-context
Type-Context
@@ -519,7 +519,7 @@
(if (is? expected actual)
(check/wrap assumptions)
(with-error-stack
- (function (_ _) (ex.construct Type-Check-Failed [expected actual]))
+ (function (_ _) (ex.construct type-check-failed [expected actual]))
(case [expected actual]
[(#.Var idE) (#.Var idA)]
(check-vars check' assumptions idE idA)
diff --git a/stdlib/source/lux/macro/poly.lux b/stdlib/source/lux/macro/poly.lux
index 763596473..0c30eb9c2 100644
--- a/stdlib/source/lux/macro/poly.lux
+++ b/stdlib/source/lux/macro/poly.lux
@@ -286,7 +286,7 @@
_
(p.fail ($_ text/compose "Not a bound type: " (type.to-text headT))))))
-(exception: #export (Not-Existential-Type {type Type})
+(exception: #export (not-existential-type {type Type})
(type.to-text type))
(def: #export existential
@@ -298,7 +298,7 @@
(wrap ex-id)
_
- (p.fail (ex.construct Not-Existential-Type headT)))))
+ (p.fail (ex.construct not-existential-type headT)))))
(def: #export named
(Poly [Ident Type])
diff --git a/stdlib/source/lux/math/constructive.lux b/stdlib/source/lux/math/constructive.lux
index c360a0552..4cc1a839e 100644
--- a/stdlib/source/lux/math/constructive.lux
+++ b/stdlib/source/lux/math/constructive.lux
@@ -188,9 +188,9 @@
(#True p)
(#False (not p)))
-(exception: #export Absurdity)
+(exception: #export absurd)
(.def: #export absurdity
(.All [p] (-> p .Bottom))
(.function (_ proof)
- (.error! (ex.construct Absurdity []))))
+ (.error! (ex.construct absurd []))))
diff --git a/stdlib/source/lux/math/modular.lux b/stdlib/source/lux/math/modular.lux
index 050c3feaa..068f688e2 100644
--- a/stdlib/source/lux/math/modular.lux
+++ b/stdlib/source/lux/math/modular.lux
@@ -13,7 +13,7 @@
["s" syntax #+ syntax:])
[math]))
-(exception: #export Zero-Cannot-Be-A-Modulus)
+(exception: #export zero-cannot-be-a-modulus)
(abstract: #export (Modulus m)
{#.doc "A number used as a modulus in modular arithmetic.
@@ -24,7 +24,7 @@
(def: #export (from-int value)
(Ex [m] (-> Int (Error (Modulus m))))
(if (i/= 0 value)
- (ex.throw Zero-Cannot-Be-A-Modulus [])
+ (ex.throw zero-cannot-be-a-modulus [])
(#e.Success (@abstraction value))))
(def: #export (to-int modulus)
@@ -32,13 +32,13 @@
(|> modulus @representation))
)
-(exception: #export [m] (Incorrect-Modulus {modulus (Modulus m)}
+(exception: #export [m] (incorrect-modulus {modulus (Modulus m)}
{parsed Int})
($_ text/compose
"Expected: " (int/encode (to-int modulus)) "\n"
" Actual: " (int/encode parsed) "\n"))
-(exception: #export [rm sm] (Cannot-Equalize-Moduli {reference (Modulus rm)}
+(exception: #export [rm sm] (cannot-equalize-moduli {reference (Modulus rm)}
{sample (Modulus sm)})
($_ text/compose
"Reference: " (int/encode (to-int reference)) "\n"
@@ -97,7 +97,7 @@
(<| (l.run text)
(do p.Monad<Parser>
[[remainder _ _modulus] ($_ p.seq intL (l.this separator) intL)
- _ (p.assert (ex.construct Incorrect-Modulus [modulus _modulus])
+ _ (p.assert (ex.construct incorrect-modulus [modulus _modulus])
(i/= (to-int modulus) _modulus))]
(wrap (mod modulus remainder))))))
@@ -109,7 +109,7 @@
(to-int sample-modulus))
(#e.Success (@abstraction {#remainder sample
#modulus reference-modulus}))
- (ex.throw Cannot-Equalize-Moduli [reference-modulus sample-modulus]))))
+ (ex.throw cannot-equalize-moduli [reference-modulus sample-modulus]))))
(do-template [<name> <op>]
[(def: #export (<name> reference sample)
diff --git a/stdlib/source/lux/type/resource.lux b/stdlib/source/lux/type/resource.lux
index bbef1783a..15c51c8ef 100644
--- a/stdlib/source/lux/type/resource.lux
+++ b/stdlib/source/lux/type/resource.lux
@@ -117,10 +117,10 @@
[read-sync IO io.Monad<IO>]
[read-async Promise promise.Monad<Promise>]))
-(exception: #export (Index-Cannot-Be-Repeated {index Nat})
+(exception: #export (index-cannot-be-repeated {index Nat})
(%n index))
-(exception: #export Amount-Cannot-Be-Zero)
+(exception: #export amount-cannot-be-zero)
(def: indices
(Syntax (List Nat))
@@ -131,7 +131,7 @@
(wrap (list))
(do @
[head s.nat
- _ (p.assert (ex.construct Index-Cannot-Be-Repeated head)
+ _ (p.assert (ex.construct index-cannot-be-repeated head)
(not (set.member? seen head)))
tail (recur (set.add head seen))]
(wrap (list& head tail))))))))
@@ -178,7 +178,7 @@
(Syntax Nat)
(do p.Monad<Parser>
[raw s.nat
- _ (p.assert (ex.construct Amount-Cannot-Be-Zero [])
+ _ (p.assert (ex.construct amount-cannot-be-zero [])
(n/> +0 raw))]
(wrap raw)))
diff --git a/stdlib/source/lux/world/blob.jvm.lux b/stdlib/source/lux/world/blob.jvm.lux
index a9078d69c..d644b3d68 100644
--- a/stdlib/source/lux/world/blob.jvm.lux
+++ b/stdlib/source/lux/world/blob.jvm.lux
@@ -9,10 +9,10 @@
text/format)
[host]))
-(exception: #export (Index-Out-Of-Bounds {description Text})
+(exception: #export (index-out-of-bounds {description Text})
description)
-(exception: #export (Inverted-Range {description Text})
+(exception: #export (inverted-range {description Text})
description)
(type: #export Blob (host.type (Array byte)))
@@ -37,7 +37,7 @@
(-> Nat Blob (e.Error Nat))
(if (n/< (host.array-length blob) idx)
(|> (host.array-read idx blob) byte-to-nat #e.Success)
- (ex.throw Index-Out-Of-Bounds (%n idx))))
+ (ex.throw index-out-of-bounds (%n idx))))
(def: #export (read-16 idx blob)
(-> Nat Blob (e.Error Nat))
@@ -45,7 +45,7 @@
(#e.Success ($_ bit.or
(bit.shift-left +8 (byte-to-nat (host.array-read idx blob)))
(byte-to-nat (host.array-read (n/+ +1 idx) blob))))
- (ex.throw Index-Out-Of-Bounds (%n idx))))
+ (ex.throw index-out-of-bounds (%n idx))))
(def: #export (read-32 idx blob)
(-> Nat Blob (e.Error Nat))
@@ -55,7 +55,7 @@
(bit.shift-left +16 (byte-to-nat (host.array-read (n/+ +1 idx) blob)))
(bit.shift-left +8 (byte-to-nat (host.array-read (n/+ +2 idx) blob)))
(byte-to-nat (host.array-read (n/+ +3 idx) blob))))
- (ex.throw Index-Out-Of-Bounds (%n idx))))
+ (ex.throw index-out-of-bounds (%n idx))))
(def: #export (read-64 idx blob)
(-> Nat Blob (e.Error Nat))
@@ -69,7 +69,7 @@
(bit.shift-left +16 (byte-to-nat (host.array-read (n/+ +5 idx) blob)))
(bit.shift-left +8 (byte-to-nat (host.array-read (n/+ +6 idx) blob)))
(byte-to-nat (host.array-read (n/+ +7 idx) blob))))
- (ex.throw Index-Out-Of-Bounds (%n idx))))
+ (ex.throw index-out-of-bounds (%n idx))))
(def: #export (write-8 idx value blob)
(-> Nat Nat Blob (e.Error Unit))
@@ -77,7 +77,7 @@
(exec (|> blob
(host.array-write idx (host.long-to-byte (:! Int value))))
(#e.Success []))
- (ex.throw Index-Out-Of-Bounds (%n idx))))
+ (ex.throw index-out-of-bounds (%n idx))))
(def: #export (write-16 idx value blob)
(-> Nat Nat Blob (e.Error Unit))
@@ -86,7 +86,7 @@
(host.array-write idx (host.long-to-byte (:! Int (bit.shift-right +8 value))))
(host.array-write (n/+ +1 idx) (host.long-to-byte (:! Int value))))
(#e.Success []))
- (ex.throw Index-Out-Of-Bounds (%n idx))))
+ (ex.throw index-out-of-bounds (%n idx))))
(def: #export (write-32 idx value blob)
(-> Nat Nat Blob (e.Error Unit))
@@ -97,7 +97,7 @@
(host.array-write (n/+ +2 idx) (host.long-to-byte (:! Int (bit.shift-right +8 value))))
(host.array-write (n/+ +3 idx) (host.long-to-byte (:! Int value))))
(#e.Success []))
- (ex.throw Index-Out-Of-Bounds (%n idx))))
+ (ex.throw index-out-of-bounds (%n idx))))
(def: #export (write-64 idx value blob)
(-> Nat Nat Blob (e.Error Unit))
@@ -112,7 +112,7 @@
(host.array-write (n/+ +6 idx) (host.long-to-byte (:! Int (bit.shift-right +8 value))))
(host.array-write (n/+ +7 idx) (host.long-to-byte (:! Int value))))
(#e.Success []))
- (ex.throw Index-Out-Of-Bounds (%n idx))))
+ (ex.throw index-out-of-bounds (%n idx))))
(def: #export (size blob)
(-> Blob Nat)
@@ -123,11 +123,11 @@
(with-expansions [<description> (as-is (format "from = " (%n from) " | " "to = " (%n to)))]
(let [size (host.array-length blob)]
(cond (not (n/<= to from))
- (ex.throw Inverted-Range <description>)
+ (ex.throw inverted-range <description>)
(not (and (n/< size from)
(n/< size to)))
- (ex.throw Index-Out-Of-Bounds <description>)
+ (ex.throw index-out-of-bounds <description>)
## else
(#e.Success (Arrays::copyOfRange [blob (:! Int from) (:! Int (n/inc to))]))))))
diff --git a/stdlib/source/lux/world/file.lux b/stdlib/source/lux/world/file.lux
index 957bbc7ef..3a729e936 100644
--- a/stdlib/source/lux/world/file.lux
+++ b/stdlib/source/lux/world/file.lux
@@ -11,10 +11,10 @@
(type: #export File Text)
-(exception: #export (Could-Not-Read-All-Data {file File})
+(exception: #export (could-not-read-all-data {file File})
file)
-(exception: #export (Not-A-Directory {file File})
+(exception: #export (not-a-directory {file File})
file)
(host.import #long java/io/File
@@ -75,7 +75,7 @@
_ (AutoCloseable::close [] stream)]
(if (i/= size bytes-read)
(wrap data)
- (io.io (ex.throw Could-Not-Read-All-Data file)))))
+ (io.io (ex.throw could-not-read-all-data file)))))
(def: #export (size file)
(-> File (Process Nat))
@@ -93,7 +93,7 @@
(array.to-list files))
#.None
- (io.throw Not-A-Directory dir))))
+ (io.throw not-a-directory dir))))
(do-template [<name> <method>]
[(def: #export (<name> file)
diff --git a/stdlib/source/lux/world/net/udp.jvm.lux b/stdlib/source/lux/world/net/udp.jvm.lux
index dbfa154d9..efa8c814a 100644
--- a/stdlib/source/lux/world/net/udp.jvm.lux
+++ b/stdlib/source/lux/world/net/udp.jvm.lux
@@ -40,10 +40,10 @@
############################################################
############################################################
-(exception: #export (Cannot-Resolve-Address {address //.Address})
+(exception: #export (cannot-resolve-address {address //.Address})
address)
-(exception: #export (Multiple-Candidate-Addresses {address //.Address})
+(exception: #export (multiple-candidate-addresses {address //.Address})
address)
(def: (resolve address)
@@ -52,9 +52,9 @@
[addresses (InetAddress::getAllByName [address])]
(: (io.IO (e.Error InetAddress))
(case (array.size addresses)
- +0 (io.io (ex.throw Cannot-Resolve-Address address))
+ +0 (io.io (ex.throw cannot-resolve-address address))
+1 (wrap (maybe.assume (array.read +0 addresses)))
- _ (io.io (ex.throw Multiple-Candidate-Addresses address))))))
+ _ (io.io (ex.throw multiple-candidate-addresses address))))))
(abstract: #export UDP {}
{#socket DatagramSocket}
diff --git a/stdlib/test/test/lux/concurrency/actor.lux b/stdlib/test/test/lux/concurrency/actor.lux
index 685ab169b..dc924de27 100644
--- a/stdlib/test/test/lux/concurrency/actor.lux
+++ b/stdlib/test/test/lux/concurrency/actor.lux
@@ -22,7 +22,7 @@
(wrap output)))
((stop cause state)
- (P/wrap (log! (if (ex.match? &.Poisoned cause)
+ (P/wrap (log! (if (ex.match? &.poisoned cause)
(format "Counter was poisoned: " (%n state))
cause)))))
diff --git a/stdlib/test/test/lux/control/exception.lux b/stdlib/test/test/lux/control/exception.lux
index d6a879d75..dfd55abd4 100644
--- a/stdlib/test/test/lux/control/exception.lux
+++ b/stdlib/test/test/lux/control/exception.lux
@@ -10,11 +10,11 @@
["r" math/random])
lux/test)
-(exception: Some-Exception)
+(exception: some-exception)
-(exception: Another-Exception)
+(exception: another-exception)
-(exception: Unknown-Exception)
+(exception: unknown-exception)
(context: "Exceptions"
(<| (times +100)
@@ -28,9 +28,9 @@
otherwise-val r.nat
#let [this-ex (if should-catch?
(if which?
- Some-Exception
- Another-Exception)
- Unknown-Exception)
+ some-exception
+ another-exception)
+ unknown-exception)
expected (if should-throw?
(if should-catch?
(if which?
@@ -42,8 +42,8 @@
(if should-throw?
(&.throw this-ex [])
(&.return default-val)))
- (&.catch Some-Exception (function (_ ex) some-val))
- (&.catch Another-Exception (function (_ ex) another-val))
+ (&.catch some-exception (function (_ ex) some-val))
+ (&.catch another-exception (function (_ ex) another-val))
(&.otherwise (function (_ ex) otherwise-val)))]]
(test "Catch and otherwhise handlers can properly handle the flow of exception-handling."
(n/= expected actual)))))
diff --git a/stdlib/test/test/lux/control/region.lux b/stdlib/test/test/lux/control/region.lux
index b0c9c14ac..a7a577ab5 100644
--- a/stdlib/test/test/lux/control/region.lux
+++ b/stdlib/test/test/lux/control/region.lux
@@ -10,7 +10,7 @@
["r" math/random])
lux/test)
-(exception: Oops)
+(exception: oops)
(do-template [<name> <success> <error>]
[(def: (<name> result)
@@ -59,7 +59,7 @@
(do (/.Monad<Region> @)
[_ (monad.map @ (/.acquire @@ count-clean-up)
(list.n/range +1 expected-clean-ups))
- _ (/.throw @@ Oops [])]
+ _ (/.throw @@ oops [])]
(wrap [])))
actual-clean-ups (thread.read clean-up-counter)]
(wrap (and (error? outcome)
@@ -73,7 +73,7 @@
count-clean-up (function (_ value)
(do @
[_ (thread.update n/inc clean-up-counter)]
- (wrap (: (Error Unit) (ex.throw Oops [])))))]
+ (wrap (: (Error Unit) (ex.throw oops [])))))]
outcome (/.run @
(do (/.Monad<Region> @)
[_ (monad.map @ (/.acquire @@ count-clean-up)