-
-
Notifications
You must be signed in to change notification settings - Fork 93
Open
Description
version
0.10.49 and lower
platform
JVM
problem
We can't :deny fn*
without denying the fn
macros
(sci/eval-string "((fn* [a] a) 1)" {:deny ['fn*]}) ;=> clojure.lang.ExceptionInfo: fn* is not allowed!
(sci/eval-string "((fn [a] a) 1)" {:deny ['fn*]}) ;=> clojure.lang.ExceptionInfo: fn* is not allowed!
(sci/eval-string "(defn f [a] a) (f a)" {:deny ['fn*]}) ;=> clojure.lang.ExceptionInfo: fn* is not allowed!
(sci/eval-string "(letfn [(f [a] a)] (f a))" {:deny ['fn*]}) ;=> clojure.lang.ExceptionInfo: fn* is not allowed!
(sci/eval-string "((bound-fn* (fn [a] a)) 1)" {:deny ['fn*]}) ;=> clojure.lang.ExceptionInfo: fn* is not allowed!
(sci/eval-string "((bound-fn [a] a) 1)" {:deny ['fn*]}) ;=> clojure.lang.ExceptionInfo: fn* is not allowed!
We see something similar when denying loop*
and let*
(sci/eval-string "(loop [i 10] (if (< i 0) :done (recur (dec i))))" {:deny ['loop*]})
clojure.lang.ExceptionInfo: loop* is not allowed! [at <repl>:1:1]
(sci/eval-string "(let [i 10] i)" {:deny ['let*]})
clojure.lang.ExceptionInfo: let* is not allowed! [at <repl>:1:1]
;; case is fine:
(sci/eval-string "(case 1 :ok)" {:deny ['case*]}) ;=> :ok
expected behavior
No error and the code would work like without the :deny
since fn*
is not called directly.
Metadata
Metadata
Assignees
Labels
No labels