Good eye :) It definitely doesn't, I fudged it:
impl PartialEq for LvalFun { fn eq(&self, other: &LvalFun) -> bool { match self { LvalFun::Builtin(name, _) => match other { LvalFun::Builtin(other_name, _) => name == other_name, _ => false, }, LvalFun::Lambda(env, formals, body) => match other { LvalFun::Lambda(other_env, other_f, other_b) => { formals == other_f && body == other_b && env == other_env } _ => false, }, } } }
Builtin functions are considered "equal" if they share a name, and because there are no name collisions in the environment I deemed it "good enough".
Can you think of reasons why this wouldn't be sufficient? It's on my "revisit later" list and for now seems to be working fine.
Oooh, I missed the part where you implemented that, nice workaround :D
workaround, cheat, who knows :)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Good eye :) It definitely doesn't, I fudged it:
Builtin functions are considered "equal" if they share a name, and because there are no name collisions in the environment I deemed it "good enough".
Can you think of reasons why this wouldn't be sufficient? It's on my "revisit later" list and for now seems to be working fine.
Oooh, I missed the part where you implemented that, nice workaround :D
workaround, cheat, who knows :)