Skip to content

Commit 29c10d2

Browse files
committed
fix issues
1 parent ec29031 commit 29c10d2

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

ndc_lib/src/interpreter/environment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ impl Environment {
203203
depth: depth - 1,
204204
slot,
205205
}),
206-
ResolvedVar::Global { slot } => todo!("probably disallow taking global variables"),
206+
ResolvedVar::Global { .. } => panic!("cannot take global variable from environment"),
207207
}
208208
}
209209

ndc_lib/src/stdlib/hash_map.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,12 @@ mod inner {
7777
}
7878
}
7979

80-
// TODO: adding this function breaks the new function resolution
81-
// #[function(name = "-=")]
82-
// pub fn difference_assign(lhs: &mut MapRepr, rhs: &mut MapRepr) {
83-
// let left_map: &mut HashMap<Value, Value> = &mut lhs.borrow_mut();
84-
//
85-
// left_map.difference(&*rhs.borrow());
86-
// }
80+
#[function(name = "-=")]
81+
pub fn difference_assign(lhs: &mut MapRepr, rhs: &mut MapRepr) {
82+
let left_map: &mut HashMap<Value, Value> = &mut lhs.borrow_mut();
83+
84+
left_map.difference(&*rhs.borrow());
85+
}
8786

8887
#[function(name = "~=")]
8988
pub fn symmetric_difference_assign(lhs: &mut MapRepr, rhs: &mut MapRepr) {

0 commit comments

Comments
 (0)