Comment on Compiler Development: Rust or OCaml?parentComments−gottlobflegel3yNotice from the definition of `Term`enum Term { Bool(bool), Not(Box<Term>), ... }that your code simply does not typecheck. `Not` expects a `Box<Term>`, not a `Value`.It's also worth noting that one would probably want to consider something likeNot(Not(Bool(true)))a valid term, which your implementation wouldn't.−josephg3yAh yep, my mistake. I’ve missed out on the recursive inner evaluation. Traits might work better here, but it’s not so obvious.In any case, I stand by all the other points I’ve made in my comment.−tucnak3yYou know how hard it is to take someone seriously after they embarrass themselves like that while also trying to bring somebody's code down, & ultimately being wrong?
Comments
Notice from the definition of `Term`
enum Term { Bool(bool), Not(Box<Term>), ... }
that your code simply does not typecheck. `Not` expects a `Box<Term>`, not a `Value`.
It's also worth noting that one would probably want to consider something like
Not(Not(Bool(true)))
a valid term, which your implementation wouldn't.
Ah yep, my mistake. I’ve missed out on the recursive inner evaluation. Traits might work better here, but it’s not so obvious.
In any case, I stand by all the other points I’ve made in my comment.
You know how hard it is to take someone seriously after they embarrass themselves like that while also trying to bring somebody's code down, & ultimately being wrong?