You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First and foremost, thank you so much @borkdude for all of your work, you brought the joy of clojure to scripting with your projects!
This is a bug report when trying to run some code under Babashka; the code worked with Clojure 1.10.1 but failed with Babashka.
I am using Babashka v0.2.7 , Linux Binary Distribution, which maps to version 0.2.2-SNAPSHOT of sci, hash f724f0e
Repro steps comparing the same code with clojure and with babashka:
Minimal code to repro the issue:
(defprotocolFoo (sayhello [_ name] "print a name"))
(defrecordGreeter [state] Foo (sayhello [{:keys [state]} name] (println state name)))
(sayhello (Greeter."test") "john")
Clojure 1.10.1
$ clojure
Clojure 1.10.1:
user=> (defprotocolFoo (sayhello [_ name] "print a name"))
Foo
user=> (defrecordGreeter [state] Foo (sayhello [{:keys [state]} name] (println state name)))
user.Greeter
user=> (sayhello (Greeter."test") "john")
test john
nil
Babashka v0.2.7:
$ bb
Babashka v0.2.7 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.
user=> (defprotocolFoo (sayhello [_ name] "print a name"))
{:ns #object[sci.impl.vars.SciNamespace 0x57cba1e5"user"], :methods #{#object[clojure.lang.MultiFn 0x1f6925bf"clojure.lang.MultiFn@1f6925bf"]}}
user=> (defrecordGreeter [state] Foo (sayhello [{:keys [state]} name] (println state name)))
#object[clojure.lang.MultiFn 0x1f6925bf"clojure.lang.MultiFn@1f6925bf"]
user=> (sayhello (Greeter."test") "john")
nil john
nil
expected behavior: I would expect Babashka to print "test john" and not "nil john".
There is a workaround and records are not broken (see defrecord tests in this repo), but it may trip someone who is trying to convert code from clojure to babashka/sci.
The text was updated successfully, but these errors were encountered:
First and foremost, thank you so much @borkdude for all of your work, you brought the joy of clojure to scripting with your projects!
This is a bug report when trying to run some code under Babashka; the code worked with Clojure 1.10.1 but failed with Babashka.
I am using Babashka v0.2.7 , Linux Binary Distribution, which maps to version 0.2.2-SNAPSHOT of sci, hash f724f0e
Repro steps comparing the same code with clojure and with babashka:
Minimal code to repro the issue:
Clojure 1.10.1
Babashka v0.2.7:
expected behavior: I would expect Babashka to print "test john" and not "nil john".
There is a workaround and records are not broken (see defrecord tests in this repo), but it may trip someone who is trying to convert code from clojure to babashka/sci.
The text was updated successfully, but these errors were encountered: