Fork me on GitHub

Can babashka use any clojure library as long as the library doesn't use any of the features called out e.g. I'm trying to use but I have an error.

{:deps {org.clojure/algo.monads {:mvn/version "0.1.6"}}
 :tasks {:requires [[clojure.algo.monads]]
         hello (println "hello")}} 
C:\Users\richie\project>bb hello
----- Error --------------------------------------------------------------------
Type:     clojure.lang.ExceptionInfo
Message:  Could not resolve symbol: clojure.lang.Compiler/specials
Location: clojure/tools/macro.clj:32:19
Phase:    analysis

----- Context ------------------------------------------------------------------
28: ; it impossible to shadow them by macro definitions. For most special
29: ; forms, all the arguments are simply macro-expanded, but some forms
30: ; get special treatment.
31: (def ^{:private true} special-forms
32:   (into #{} (keys clojure.lang.Compiler/specials)))
                      ^--- Could not resolve symbol: clojure.lang.Compiler/specials
33: ; Value in Clojure 1.2 and 1.3:
34: ; #{deftype* new quote & var set! monitor-enter recur . case* clojure.core/import* reify* do fn* throw monitor-exit letfn* finally let* loop* try catch if def}
36: ; The following three vars are constantly redefined using the binding
37: ; form, imitating dynamic scoping.


I need to add this field in babashka, let me fix that. Which OS are you on?


Windows right?


Thanks, yea it works.


I've implemented some checks in bb/SCI for recur in non-tail position. There is one edge case. This was previously possible:

(fn [] (try (recur)))
but in Clojure it's forbidden. What should I do in SCI? Now it throws.


Is there a reason not to keep Clojure semantics? Backwards compatibility for existing bb/SCI code?


It was previously allowed in SCI, it's just not allowed in Clojure


(fn [] (try (recur)))
is also not allowed in CLJS, so I'd say not allowing it is more in line with the reference implementations

👍 3

@maximilian is killing it lately. he's added cycle detection to bb.edn in clj-kondo.

❤️ 4