phronmophobic/membrane

improve `membrane.component/parse-path` to avoid instances of shadowing and multiple evaluation

phronmophobic opened this issue · 0 comments

Parse path will update the "path" for a binding using something like the following:

         (clojure.core/nth nth)
         [(second form)
          `(list (quote ~'nth) ~(nth form 2))]

This generally works, but there are some subtle issues with the value of ~(nth form 2) being potentially evaluated multiple times, shadowed, and/or producing different values when the $ref is used.

A potential fix would be to just insert a new binding for the index. However, that might add a lot of code bloat, especially since most bindings will never be referenced.