feat(env): Rc

This commit is contained in:
2025-05-17 19:10:10 +08:00
parent ff9afd0cc1
commit fb14027845
6 changed files with 44 additions and 65 deletions

View File

@@ -1,5 +1,4 @@
use std::collections::HashSet;
use std::rc::Rc;
use derive_more::Constructor;
use itertools::Itertools;
@@ -43,7 +42,7 @@ impl<'vm> AttrSet<'vm> {
self.data.get(&sym).is_some()
}
pub fn capture(&mut self, env: &Rc<Env<'vm>>) {
pub fn capture(&mut self, env: &Env<'vm>) {
self.data.iter().for_each(|(_, v)| match v.clone() {
Value::Thunk(ref thunk) => {
thunk.capture(env.clone());