I am trying to write a function eval-with-bindmap which takes two parameters, an expression to evaluate and a map of symbols to values which will act as bindings in the evaluation. I cannot use let since the bindings may be in any order in the map (it should work with both array-maps and hash-maps) and it may also contain bindings of functions which are mutually recursive (as in letfn). For example:
(eval-with-bindmap '(+ a b) '{a (+ 1 b) b 2}) => 5
Any tips on how to approach this would be awesome, thank-you.