Closed Qix- closed 1 year ago
I think this one is worth doing - it's unfortunate that env functions right now can't eg. mutate state in their Rust closure - but it gets pretty complicated/subtle with the lifetimes and traits involved, and I want to make extra sure it's done in the best way, so I'm going to give it a deeper look/research and comment here again after that
I've implemented an alternate version of this which allows FnMut
closures, enabling state mutation from within closures without the use of unsafe { }
: https://github.com/brundonsmith/rust_lisp/commit/af8ba5ff05ad6f4476f384e23cc443eef9fc883e
This adds support for
NativeClosure
functions that accept closures instead of 'naked' functions.