Since the type checker sucks less now, we can think about maybe adding some features to the language. ...At some point I'd like to have the type checker clean up the index map.
22 lines
376 B
Common Lisp
22 lines
376 B
Common Lisp
//! The Result type, indicating a fallible operation.
|
|
|
|
pub enum Result<T, E> {
|
|
Ok(T),
|
|
Err(E),
|
|
}
|
|
|
|
impl Result {
|
|
pub fn is_ok(&self) -> bool {
|
|
match self {
|
|
Ok(_) => true,
|
|
Err(_) => false,
|
|
}
|
|
}
|
|
pub fn is_err(&self) -> bool {
|
|
match self {
|
|
Ok(_) => false,
|
|
Err(_) => true,
|
|
}
|
|
}
|
|
}
|