Fork me on GitHub
#babashka
<
2021-12-17
>
cfleming00:12:30

What is my best option in Babashka for creating something that I can customise print-method for? I’d like to return a tagged literal from the REPL. I understand there’s no deftype, is defrecord the best bet for this?

borkdude08:12:15

We have an open issue for this here: https://github.com/babashka/babashka/issues/734 Feel free to upvote it. We do allow to override toString on defrecords now

cfleming09:12:22

Actually, tagged-literal might work for what I need, and should be compatible with Clojure. TIL!

👍 1
ianjones16:12:21

hey yall! Im loving bb . I’ve been learning fulcro and a couple of the projects have been using it as a way to start the apps! Im coming from the JS ecosystem and am used to easily creating serverless functions with frameworks like next.js. Im wondering if anyone has a solution for this with nbb and aws lambdas (or something else) they could point me to

ianjones16:12:50

clojure flavored jamstack 😄

ianjones16:12:05

oh shoot, I can move this question to #nbb

borkdude16:12:25

you can even edit the CLJS code in the AWS console :)

borkdude16:12:37

yeah, let's go to #nbb for this

ianjones16:12:44

awesome. exactly what Im looking for!

rwstauner22:12:52

this is probably sci, but i'm not sure how to test that easily atm so i thought i'd ask here first.

$ clj
user=> (defn foo [a b] (prn a b))
#'user/foo
user=> (apply foo [1 2 3])
Execution error (ArityException) at user/eval7940 (REPL:1).
Wrong number of args (3) passed to: user/foo
$ bb
*user=> (defn foo [a b] (prn a b))
#'user/foo
*user=> (apply foo [1 2 2] )
clojure.lang.ArityException: Wrong number of args (3) passed to: clojure.core/apply [at <repl>:2:1]
the ArityException mentions "apply" rather than the function apply is calling

borkdude22:12:04

There is an issue for it here: https://github.com/babashka/sci/issues/653 Feel free to upvote

rwstauner22:12:59

thanks, i looked, but searched for "apply" so i didn't find it 😕

borkdude22:12:19

Feel free to add the word apply to the issue or the full error

rwstauner22:12:27

will do, thanks!

Cnly03:12:12

I’ve changed the issue title to Wrong arity error messages for certain functions (apply, reduce)