Fun With Rust's Traits

from blog samwho.dev, | ↗ original
Rust's trait system is wonderful. Everyone I know that has used it agrees with this statement. It's a great way to encode shared behaviour between data types, and create flexible APIs. It's also great for writing nonsense like this: use std::f64::consts::PI; use lisp::prelude::*; fn main() { let r = 3.0; let res = eval((mul, PI, (mul, r,...