Open William103 opened 1 year ago
... can you just make everything methods on a struct?
That was my first attempt. I'm translating some SML code, so it gets wild with all the references. The callbacks everywhere would end up needing to take a &mut self
as well as convert_record
and its callbacks, and that's too many mutable references for the borrow checker to be happy. It could maybe be possible with a bunch of Rc<RefCell<self>>
but that sounds horrible. I'm sure there's a way to do the whole algorithm more imperatively with a struct but idk how; I barely understand the functional version.
Implement #17. I'm currently almost done, but things are still very rough around the edges.
TODOS in no particular order:
compile_match_tree
andconvert_decision_tree
inconvert_expr
choice_defs
from hir program to get a list of all variants for each choice type (i.e. implementresolve_path
)Rc
's, rather than just cloning everythingEventually, probably in a different PR, I'd like to write a new interpreter that interprets the CPS code.