Cannot deny `fn*` without denying the `fn` macros
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
Research direction
Start by reproducing the reported expressions through sci/eval-string with :deny, comparing direct fn* use against fn, defn, letfn, bound-fn, loop*, and let*. Done means indirect forms continue to work while directly invoking a denied special form still raises the expected error.
Written by the indexing model from the issue text.
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.
- Dominant language
- Clojure
- Stars
- 1.4k
- Forks
- 109
- Avg merge
- 1m
- Merged PRs (30d)
- 26
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from babashka/sci
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
babashka/sci#1097 · 3 comments ·
Maintainers usually reply within 1 day
-
JVM: implement a host (Clojure) protocol from sci — copy-var on a protocol var (ADR 0013, half 1)Possibly taken @yogthos claimed this 80 days ago. Open
Difficulty 5/5 Over a week Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
Explore forkable SCI runtime worldsMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 5/5 Over a week Newbie friendliness 20/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
babashka/sci#1040 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nextjournal/clerk#830 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
IOP tokens release blocker team qa team qa autotests WG adoption
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
penpot/penpot#13540 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
izhangzhihao/intellij-rainbow-brackets#2903 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100