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:
2025-01-31 03:34:45 -06:00
parent 0c2b0002ce
commit d95d35268e
6 changed files with 230 additions and 211 deletions

View File

@@ -17,11 +17,6 @@ pub trait Callable: std::fmt::Debug {
fn name(&self) -> Sym;
}
/// [BuiltIn]s are [Callable]s with bespoke definitions
pub trait BuiltIn: std::fmt::Debug + Callable {
fn description(&self) -> &str;
}
pub mod convalue;
pub mod interpret;