0
我正在關注this series以瞭解clojure編譯器的工作原理。如何調用StaticMethodExpr.eval?
我嘗試使用下面的代碼
(ns clojure.lang
(:use clojure.core)
(:import [clojure.lang Compiler Compiler$C]))
(def form (read-string "(+ 1 1)"))
(def expr (Compiler/analyze Compiler$C/EXPRESSION form))
(.eval expr)
,但沒有運氣援引StaticMethodExpr
eval
方法,並拋出IllegalArgumentException
:
Unhandled java.lang.IllegalArgumentException
Can't call public method of non-public class: public
java.lang.Object clojure.lang.Compiler$StaticMethodExpr.eval()
有什麼我失蹤,或者這是a bug in jdk?