Compare commits
1 Commits
main
...
improve_pr
Author | SHA1 | Date | |
---|---|---|---|
|
2fbf82f8ab |
|
@ -903,6 +903,13 @@ fn assert! {
|
||||||
else panic! string ("Assert failed: ", msg, " with ", value)
|
else panic! string ("Assert failed: ", msg, " with ", value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fn assert {
|
||||||
|
"Asserts a condition. Returns a result tuple: `(:ok, value)` if the value is truthy, and `(:err, value)` if it is falsy. Or, give it an error message, and that's what'll be in the error tuple instead."
|
||||||
|
(value) -> if value then (:ok, value) else (:err, value)
|
||||||
|
(msg, value) -> if value then (:ok, value) else (:err, msg)
|
||||||
|
}
|
||||||
|
|
||||||
&&& Turtle & other graphics
|
&&& Turtle & other graphics
|
||||||
|
|
||||||
& some basic colors
|
& some basic colors
|
||||||
|
@ -1282,6 +1289,7 @@ ns prelude {
|
||||||
unwrap!
|
unwrap!
|
||||||
unwrap_or
|
unwrap_or
|
||||||
assert!
|
assert!
|
||||||
|
assert
|
||||||
colors
|
colors
|
||||||
forward!, fd!
|
forward!, fd!
|
||||||
back!, bk!
|
back!, bk!
|
||||||
|
|
Loading…
Reference in New Issue
Block a user