cl-interpret: Builtin refactor
- Everything is different now - Builtins are now built on top of Rust functions, so they can be recursive! - TODO: allow macro-defined builtins to call each other? - The builtins! macro is a lot nicer to work with - No redundant return value - Maps the result over Into::into, allowing for type inference! - Uses explicit pattern syntax instead of weird binding, where possible - Does not #[allow(unused)], so you'll get unused variable warnings now!
This commit is contained in:
@@ -345,7 +345,8 @@ mod assignment {
|
||||
|
||||
pub(super) fn pat_assign(env: &mut Environment, pat: &Pattern, value: ConValue) -> IResult<()> {
|
||||
let mut substitution = HashMap::new();
|
||||
append_sub(&mut substitution, pat, value).map_err(|_| Error::PatFailed(pat.clone()))?;
|
||||
append_sub(&mut substitution, pat, value)
|
||||
.map_err(|_| Error::PatFailed(pat.clone().into()))?;
|
||||
for (path, value) in substitution {
|
||||
assign_path(env, path, value)?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user