fix: thunk & function
This commit is contained in:
@@ -42,23 +42,18 @@ impl<'vm> AttrSet<'vm> {
|
||||
self.data.get(&sym).is_some()
|
||||
}
|
||||
|
||||
pub fn capture(&mut self, env: Rc<Env<'vm>>) {
|
||||
self.data = self
|
||||
pub fn capture(&mut self, env: &Rc<Env<'vm>>) {
|
||||
self
|
||||
.data
|
||||
.into_iter()
|
||||
.map(|(k, v)| {
|
||||
(
|
||||
k.clone(),
|
||||
.iter()
|
||||
.for_each(|(_, v)| {
|
||||
match v.clone() {
|
||||
x @ Value::ThunkRef(thunk) => {
|
||||
Value::Thunk(ref thunk) => {
|
||||
thunk.capture(env.clone());
|
||||
x
|
||||
}
|
||||
x => x,
|
||||
},
|
||||
)
|
||||
_ => ()
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
}
|
||||
|
||||
pub fn update(mut self, other: AttrSet<'vm>) -> AttrSet<'vm> {
|
||||
@@ -83,7 +78,7 @@ impl<'vm> AttrSet<'vm> {
|
||||
&self.data
|
||||
}
|
||||
|
||||
pub fn force_deep(&mut self, vm: &VM<'vm, '_>) -> Result<()> {
|
||||
pub fn force_deep(&mut self, vm: &'vm VM<'_>) -> Result<()> {
|
||||
let mut map: Vec<_> = self
|
||||
.data
|
||||
.into_iter()
|
||||
@@ -170,7 +165,7 @@ impl<'vm> RecAttrSet<'vm> {
|
||||
RecAttrSet { data }
|
||||
}
|
||||
|
||||
pub fn force_deep(&mut self, vm: &VM<'vm, '_>) -> Result<()> {
|
||||
pub fn force_deep(&mut self, vm: &'vm VM<'_>) -> Result<()> {
|
||||
let mut map: Vec<_> = self
|
||||
.data
|
||||
.map
|
||||
|
||||
Reference in New Issue
Block a user