ClojureScript

Unable to eval some forms passed to instrument

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:

Description

The following REPL sequence works in Clojure and also downstream in self-hosted ClojureScript Planck, but not in JVM ClojureScript:

$ clj -m cljs.main -re node -r
ClojureScript 1.10.439
cljs.user=> (require '[clojure.spec.test.alpha :as st])
nil
cljs.user=> (require '[clojure.spec.alpha :as s])
nil
cljs.user=> (defn foo [x] (inc x))
#'cljs.user/foo
cljs.user=> (defn bar [x] (inc x))
#'cljs.user/bar
cljs.user=> (s/fdef foo :args (s/cat :x int?))
cljs.user/foo
cljs.user=> (s/fdef bar :args (s/cat :x int?))
cljs.user/bar
cljs.user=> (st/instrumentable-syms)
#{cljs.user/foo cljs.user/bar}
cljs.user=> (disj (st/instrumentable-syms) `bar)
#{cljs.user/foo}
cljs.user=> (st/instrument (disj (st/instrumentable-syms) `bar))
clojure.lang.ExceptionInfo: Syntax error compiling at (1:16). at line 1 <cljs repl> {:file "<cljs repl>", :line 1, :column 1, :root-source-info {:source-type :fragment, :source-form (st/instrument (disj (st/instrumentable-syms) (quote cljs.user/bar)))}, :tag :cljs/analysis-error}
	at cljs.analyzer$error.invokeStatic(analyzer.cljc:718)
	at cljs.analyzer$error.invoke(analyzer.cljc:714)
	at cljs.analyzer$macroexpand_1.invokeStatic(analyzer.cljc:3594)
	at cljs.analyzer$macroexpand_1.invoke(analyzer.cljc:3590)
	at cljs.analyzer$analyze_seq.invokeStatic(analyzer.cljc:3627)
	at cljs.analyzer$analyze_seq.invoke(analyzer.cljc:3607)
	at cljs.analyzer$analyze_form.invokeStatic(analyzer.cljc:3810)
	at cljs.analyzer$analyze_form.invoke(analyzer.cljc:3807)
	at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:3860)
	at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:3851)
	at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3880)
	at cljs.analyzer$analyze.invoke(analyzer.cljc:3863)
	at cljs.analyzer$analyze_seq.invokeStatic(analyzer.cljc:3630)
	at cljs.analyzer$analyze_seq.invoke(analyzer.cljc:3607)
	at cljs.analyzer$analyze_form.invokeStatic(analyzer.cljc:3810)
	at cljs.analyzer$analyze_form.invoke(analyzer.cljc:3807)
	at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:3860)
	at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:3851)
	at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3880)
	at cljs.analyzer$analyze.invoke(analyzer.cljc:3863)
	at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3873)
	at cljs.analyzer$analyze.invoke(analyzer.cljc:3863)
	at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3871)
	at cljs.analyzer$analyze.invoke(analyzer.cljc:3863)
	at cljs.analyzer$analyze_let_binding_init.invokeStatic(analyzer.cljc:2062)
	at cljs.analyzer$analyze_let_binding_init.invoke(analyzer.cljc:2060)
	at cljs.analyzer$analyze_let_bindings_STAR_.invokeStatic(analyzer.cljc:2082)
	at cljs.analyzer$analyze_let_bindings_STAR_.invoke(analyzer.cljc:2071)
	at cljs.analyzer$analyze_let_bindings.invokeStatic(analyzer.cljc:2114)
	at cljs.analyzer$analyze_let_bindings.invoke(analyzer.cljc:2113)
	at cljs.analyzer$analyze_let.invokeStatic(analyzer.cljc:2130)
	at cljs.analyzer$analyze_let.invoke(analyzer.cljc:2124)
	at cljs.analyzer$fn__1898.invokeStatic(analyzer.cljc:2150)
	at cljs.analyzer$fn__1898.invoke(analyzer.cljc:2148)
	at clojure.lang.MultiFn.invoke(MultiFn.java:252)
	at cljs.analyzer$analyze_seq_STAR_.invokeStatic(analyzer.cljc:3600)
	at cljs.analyzer$analyze_seq_STAR_.invoke(analyzer.cljc:3598)
	at cljs.analyzer$analyze_seq_STAR__wrap.invokeStatic(analyzer.cljc:3605)
	at cljs.analyzer$analyze_seq_STAR__wrap.invoke(analyzer.cljc:3603)
	at cljs.analyzer$analyze_seq.invokeStatic(analyzer.cljc:3629)
	at cljs.analyzer$analyze_seq.invoke(analyzer.cljc:3607)
	at cljs.analyzer$analyze_form.invokeStatic(analyzer.cljc:3810)
	at cljs.analyzer$analyze_form.invoke(analyzer.cljc:3807)
	at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:3860)
	at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:3851)
	at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3880)
	at cljs.analyzer$analyze.invoke(analyzer.cljc:3863)
	at cljs.analyzer$analyze_seq.invokeStatic(analyzer.cljc:3630)
	at cljs.analyzer$analyze_seq.invoke(analyzer.cljc:3607)
	at cljs.analyzer$analyze_form.invokeStatic(analyzer.cljc:3810)
	at cljs.analyzer$analyze_form.invoke(analyzer.cljc:3807)
	at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:3860)
	at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:3851)
	at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3880)
	at cljs.analyzer$analyze.invoke(analyzer.cljc:3863)
	at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3873)
	at cljs.analyzer$analyze.invoke(analyzer.cljc:3863)
	at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3871)
	at cljs.analyzer$analyze.invoke(analyzer.cljc:3863)
	at cljs.analyzer$parse_invoke_STAR_$ana_expr__2396.invoke(analyzer.cljc:3373)
	at clojure.core$mapv$fn__8436.invoke(core.clj:6892)
	at clojure.lang.PersistentList.reduce(PersistentList.java:141)
	at clojure.core$reduce.invokeStatic(core.clj:6807)
	at clojure.core$mapv.invokeStatic(core.clj:6883)
	at clojure.core$mapv.invoke(core.clj:6883)
	at cljs.analyzer$parse_invoke_STAR_.invokeStatic(analyzer.cljc:3374)
	at cljs.analyzer$parse_invoke_STAR_.invoke(analyzer.cljc:3322)
	at cljs.analyzer$parse_invoke.invokeStatic(analyzer.cljc:3380)
	at cljs.analyzer$parse_invoke.invoke(analyzer.cljc:3378)
	at cljs.analyzer$analyze_seq_STAR_.invokeStatic(analyzer.cljc:3601)
	at cljs.analyzer$analyze_seq_STAR_.invoke(analyzer.cljc:3598)
	at cljs.analyzer$analyze_seq_STAR__wrap.invokeStatic(analyzer.cljc:3605)
	at cljs.analyzer$analyze_seq_STAR__wrap.invoke(analyzer.cljc:3603)
	at cljs.analyzer$analyze_seq.invokeStatic(analyzer.cljc:3629)
	at cljs.analyzer$analyze_seq.invoke(analyzer.cljc:3607)
	at cljs.analyzer$analyze_form.invokeStatic(analyzer.cljc:3810)
	at cljs.analyzer$analyze_form.invoke(analyzer.cljc:3807)
	at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:3860)
	at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:3851)
	at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3880)
	at cljs.analyzer$analyze.invoke(analyzer.cljc:3863)
	at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3873)
	at cljs.analyzer$analyze.invoke(analyzer.cljc:3863)
	at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3871)
	at cljs.analyzer$analyze.invoke(analyzer.cljc:3863)
	at cljs.analyzer$fn__1879.invokeStatic(analyzer.cljc:2041)
	at cljs.analyzer$fn__1879.invoke(analyzer.cljc:2037)
	at clojure.lang.MultiFn.invoke(MultiFn.java:252)
	at cljs.analyzer$analyze_seq_STAR_.invokeStatic(analyzer.cljc:3600)
	at cljs.analyzer$analyze_seq_STAR_.invoke(analyzer.cljc:3598)
	at cljs.analyzer$analyze_seq_STAR__wrap.invokeStatic(analyzer.cljc:3605)
	at cljs.analyzer$analyze_seq_STAR__wrap.invoke(analyzer.cljc:3603)
	at cljs.analyzer$analyze_seq.invokeStatic(analyzer.cljc:3629)
	at cljs.analyzer$analyze_seq.invoke(analyzer.cljc:3607)
	at cljs.analyzer$analyze_form.invokeStatic(analyzer.cljc:3810)
	at cljs.analyzer$analyze_form.invoke(analyzer.cljc:3807)
	at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:3860)
	at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:3851)
	at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3880)
	at cljs.analyzer$analyze.invoke(analyzer.cljc:3863)
	at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3873)
	at cljs.analyzer$analyze.invoke(analyzer.cljc:3863)
	at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3871)
	at cljs.analyzer$analyze.invoke(analyzer.cljc:3863)
	at cljs.analyzer$fn__1729$fn__1753.invoke(analyzer.cljc:1564)
	at cljs.analyzer$fn__1729.invokeStatic(analyzer.cljc:1564)
	at cljs.analyzer$fn__1729.invoke(analyzer.cljc:1511)
	at clojure.lang.MultiFn.invoke(MultiFn.java:252)
	at cljs.analyzer$analyze_seq_STAR_.invokeStatic(analyzer.cljc:3600)
	at cljs.analyzer$analyze_seq_STAR_.invoke(analyzer.cljc:3598)
	at cljs.analyzer$analyze_seq_STAR__wrap.invokeStatic(analyzer.cljc:3605)
	at cljs.analyzer$analyze_seq_STAR__wrap.invoke(analyzer.cljc:3603)
	at cljs.analyzer$analyze_seq.invokeStatic(analyzer.cljc:3629)
	at cljs.analyzer$analyze_seq.invoke(analyzer.cljc:3607)
	at cljs.analyzer$analyze_form.invokeStatic(analyzer.cljc:3810)
	at cljs.analyzer$analyze_form.invoke(analyzer.cljc:3807)
	at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:3860)
	at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:3851)
	at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3880)
	at cljs.analyzer$analyze.invoke(analyzer.cljc:3863)
	at cljs.repl$evaluate_form$__GT_ast__6567.invoke(repl.cljc:517)
	at cljs.repl$evaluate_form.invokeStatic(repl.cljc:519)
	at cljs.repl$evaluate_form.invoke(repl.cljc:499)
	at cljs.repl$eval_cljs.invokeStatic(repl.cljc:689)
	at cljs.repl$eval_cljs.invoke(repl.cljc:682)
	at cljs.repl$repl_STAR_$read_eval_print__6752.invoke(repl.cljc:985)
	at cljs.repl$repl_STAR_$fn__6758$fn__6767.invoke(repl.cljc:1026)
	at cljs.repl$repl_STAR_$fn__6758.invoke(repl.cljc:1025)
	at cljs.compiler$with_core_cljs.invokeStatic(compiler.cljc:1416)
	at cljs.compiler$with_core_cljs.invoke(compiler.cljc:1405)
	at cljs.repl$repl_STAR_.invokeStatic(repl.cljc:988)
	at cljs.repl$repl_STAR_.invoke(repl.cljc:861)
	at cljs.cli$repl_opt.invokeStatic(cli.clj:314)
	at cljs.cli$repl_opt.invoke(cli.clj:301)
	at cljs.cli$main.invokeStatic(cli.clj:646)
	at cljs.cli$main.doInvoke(cli.clj:635)
	at clojure.lang.RestFn.applyTo(RestFn.java:139)
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$apply.invoke(core.clj:660)
	at cljs.main$_main.invokeStatic(main.clj:61)
	at cljs.main$_main.doInvoke(main.clj:52)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:705)
	at clojure.core$apply.invokeStatic(core.clj:665)
	at clojure.main$main_opt.invokeStatic(main.clj:469)
	at clojure.main$main_opt.invoke(main.clj:465)
	at clojure.main$main.invokeStatic(main.clj:576)
	at clojure.main$main.doInvoke(main.clj:539)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:705)
	at clojure.main.main(main.java:37)
Caused by: Syntax error compiling at (1:16).
Unable to resolve symbol: disj in this context
	at clojure.lang.Compiler.analyze(Compiler.java:6808)
	at clojure.lang.Compiler.analyze(Compiler.java:6745)
	at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3820)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:7110)
	at clojure.lang.Compiler.analyze(Compiler.java:6789)
	at clojure.lang.Compiler.analyze(Compiler.java:6745)
	at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6120)
	at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5467)
	at clojure.lang.Compiler$FnExpr.parse(Compiler.java:4029)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:7106)
	at clojure.lang.Compiler.analyze(Compiler.java:6789)
	at clojure.lang.Compiler.eval(Compiler.java:7175)
	at clojure.lang.Compiler.eval(Compiler.java:7133)
	at clojure.core$eval.invokeStatic(core.clj:3214)
	at clojure.core$eval.invoke(core.clj:3210)
	at cljs.spec.test.alpha$form__GT_sym_or_syms.invokeStatic(alpha.cljc:99)
	at cljs.spec.test.alpha$form__GT_sym_or_syms.invoke(alpha.cljc:90)
	at cljs.spec.test.alpha$instrument.invokeStatic(alpha.cljc:145)
	at cljs.spec.test.alpha$instrument.invoke(alpha.cljc:101)
	at clojure.lang.AFn.applyToHelper(AFn.java:165)
	at clojure.lang.AFn.applyTo(AFn.java:144)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$apply.invoke(core.clj:660)
	at cljs.analyzer$macroexpand_1_STAR_$fn__2437.invoke(analyzer.cljc:3547)
	at cljs.analyzer$macroexpand_1_STAR_.invokeStatic(analyzer.cljc:3546)
	at cljs.analyzer$macroexpand_1_STAR_.invoke(analyzer.cljc:3533)
	... 149 more
Caused by: java.lang.RuntimeException: Unable to resolve symbol: disj in this context
	at clojure.lang.Util.runtimeException(Util.java:221)
	at clojure.lang.Compiler.resolveIn(Compiler.java:7415)
	at clojure.lang.Compiler.resolve(Compiler.java:7359)
	at clojure.lang.Compiler.analyzeSymbol(Compiler.java:7320)
	at clojure.lang.Compiler.analyze(Compiler.java:6768)
	... 174 more

Activity

Hide
Mike Fikes added a comment - - edited

The only reason we are involving eval it to simplify the handling of quoted forms: https://github.com/clojure/clojurescript/commit/f2424b6b04d63694dcc050989b592566fee03992
In other words, it helps with massaging compile-time data, but it doesn't give us full dynamic evaluation capability.

Show
Mike Fikes added a comment - - edited The only reason we are involving eval it to simplify the handling of quoted forms: https://github.com/clojure/clojurescript/commit/f2424b6b04d63694dcc050989b592566fee03992 In other words, it helps with massaging compile-time data, but it doesn't give us full dynamic evaluation capability.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: