joinr / clclojure

An experimental port of clojure to common lisp. Also some native common lisp implementations of clojure libraries, like seq, persistent vectors, etc.
Eclipse Public License 1.0
224 stars 8 forks source link

Regression after fixing lexical literals #2

Closed joinr closed 4 years ago

joinr commented 4 years ago

Revisiting examples, discovered some tomfoolery leading to errors related to the patch from a044c60d59692f132fb54d5e44f3f3ac88f8c70a that aimed to correct the behavior for lexical literals and splicing. We now get non-literal vector forms going into macros for extend-type and friends, leading to type errors since we have (persistent-vector ..) forms instead of vector literals.

joinr commented 4 years ago

Definitely tied directly to lexical binds for literals. Without walking the form, we get [x] turning into (peristent-vector x) and end up pitching a fit. Traded general correctness for some jank, at least with legacy cl:let invocations.

joinr commented 4 years ago

I didn't think through the implications of adding a custom evaluation model to allow for transforming literals (e.g. [x]) into (persistent-vector x). The problem that's biting us now is that, during macroexpansion we're fine - our persistent vector forms are left alone. If we have a form inside a let or other binding, then that persistent vector will be walked and transformed into the sexpr. This throws a wrench in the expectations for protocol forms which anticipate having a literal vector for the arg bindings.

joinr commented 4 years ago

Fixed (apparently) in 3881f77c1894de86b2bdd80176809ccaa0cb6489