|
531 | 531 | (let [e (->eval-node &a nil e)]
|
532 | 532 | (gen-eval-node (throw (evalme e &b)))))
|
533 | 533 |
|
534 |
| -(defmethod seq->eval-node 'clojure.core/eval [&a _ [_ e]] |
535 |
| - (let [e (->eval-node &a nil e)] |
536 |
| - (gen-eval-node (-> e (evalme &b) (evalme nil))))) |
537 |
| - |
538 | 534 | (defmethod seq->eval-node 'var [&a _ [_ v]]
|
539 | 535 | (let [x (resolve v)]
|
540 | 536 | (assert x (str "Unable to resolve var: " (pr-str v) " in this context in ns " *ns*))
|
|
695 | 691 | (mapcat (comp ::symbol-used meta)
|
696 | 692 | (concat bodies (take-nth 2 (next bindings))))))
|
697 | 693 | symbol-introduced (-> introduced-idents
|
698 |
| - (into (mapcat (comp ::symbol-introduced meta) bodies)) |
699 |
| - (into (mapcat (comp ::symbol-introduced meta) bindings)))] |
| 694 | + (into (mapcat (comp ::symbol-introduced meta)) bodies) |
| 695 | + (into (mapcat (comp ::symbol-introduced meta)) bindings))] |
700 | 696 | (with-meta (list* form bindings bodies)
|
701 | 697 | {::symbol-used symbol-used
|
702 | 698 | ::symbol-introduced symbol-introduced
|
|
753 | 749 | catches
|
754 | 750 | (when finally-bodies [(list* 'finally finally-bodies)]))
|
755 | 751 | {::symbol-used (-> #{}
|
756 |
| - (into (mapcat (comp ::symbol-used meta) bodies)) |
757 |
| - (into (mapcat ::symbol-used catch-metas)) |
758 |
| - (into (mapcat (comp ::symbol-used meta) finally-bodies)) |
| 752 | + (into (mapcat (comp ::symbol-used meta)) bodies) |
| 753 | + (into (mapcat ::symbol-used) catch-metas) |
| 754 | + (into (mapcat (comp ::symbol-used meta)) finally-bodies) |
759 | 755 | (->> (remove #{catch-identity}))
|
760 | 756 | (set))
|
761 | 757 | ::symbol-introduced (-> #{}
|
762 |
| - (into (mapcat (comp ::symbol-introduced meta) bodies)) |
763 |
| - (into (mapcat ::symbol-introduced catch-metas)) |
764 |
| - (into (mapcat (comp ::symbol-introduced meta) finally-bodies)) |
| 758 | + (into (mapcat (comp ::symbol-introduced meta)) bodies) |
| 759 | + (into (mapcat ::symbol-introduced) catch-metas) |
| 760 | + (into (mapcat (comp ::symbol-introduced meta)) finally-bodies) |
765 | 761 | (cond-> (seq catches) (conj catch-identity)))})))
|
766 | 762 |
|
767 | 763 | (defmethod enhance-code 'letfn* [sym->iden [letfn* bindings & bodies]]
|
|
772 | 768 | bodies (for [body bodies] (enhance-code sym->iden body))
|
773 | 769 | symbol-added (set (map (comp ::symbol-identity meta first) binding-pairs))
|
774 | 770 | symbol-used (-> #{}
|
775 |
| - (into (mapcat (comp ::symbol-used meta second) binding-pairs)) |
776 |
| - (into (mapcat (comp ::symbol-used meta) bodies)) |
| 771 | + (into (mapcat (comp ::symbol-used meta second)) binding-pairs) |
| 772 | + (into (mapcat (comp ::symbol-used meta)) bodies) |
777 | 773 | (->> (remove symbol-added))
|
778 | 774 | (set))
|
779 | 775 | symbol-introduced (-> #{}
|
780 |
| - (into (mapcat (comp ::symbol-introduced meta) bodies)) |
| 776 | + (into (mapcat (comp ::symbol-introduced meta)) bodies) |
781 | 777 | (into symbol-added))]
|
782 | 778 | (with-meta
|
783 | 779 | (list* letfn* (vec (apply concat binding-pairs)) bodies)
|
|
792 | 788 | ;; array is empty yet.
|
793 | 789 | (evalme node nil)))
|
794 | 790 |
|
| 791 | +(custom-var! #'clojure.core/eval evaluator) |
| 792 | + |
795 | 793 | (defn- all-test-namespaces []
|
796 | 794 | (for [ns (all-ns)
|
797 | 795 | :when (or (ns-resolve ns 'test-ns-hook)
|
|
0 commit comments