Fork me on GitHub
#babashka
<
2022-02-16
>
borkdude10:02:41

Babashka 0.7.5 with significant performance improvements. More of those to come in 2022! https://github.com/babashka/babashka/blob/master/CHANGELOG.md#075-2022-02-16

🎉 9
martinklepsch10:02:06

I’m getting an error No dispatch macro for: " when trying to use the following in a task:

(string/replace s #"xx" "'xxx'")
Am I missing something here? :thinking_face:

borkdude10:02:04

@martinklepsch tasks are defined in an .edn file and regex literals aren't supported in EDN. you have the following options: 1. Add :paths and :requires and move the code to a file on the classpath (in one of the :paths). 2. Use (re-pattern ...)

martinklepsch10:02:31

Ahhh, ofc! Thank you

martinklepsch10:02:34

So easy to forget when your task is growing beyond a line or two

borkdude10:02:09

yeah I think we should encourage people to put most of their code in a file, which makes it also more REPL-friendly

borkdude13:02:16

@martinklepsch Thanks for your Github star :)

martinklepsch13:02:30

that was long overdue lol

martinklepsch13:02:08

I don’t use stars much really so mostly doing it to signal “this is awesome” hahah

😎 1
borkdude13:02:39

Gentle reminder that I'm still running the Babashka 2022 Q1 Survey! https://docs.google.com/forms/d/e/1FAIpQLScQ13ZKsXzN594uvzxOTV8juaoETIHDk-T1XBizwe-fVh8Gyw/viewform Results will be published in an article at the end of the quarter.

👍 1
jeroenvandijk13:02:56

Do you expect Babashka only answers or can I mix some Sci in?

borkdude13:02:08

@U0FT7SRLP You can mix some SCI in, especially at the end there is some room for that

borkdude13:02:20

@U0FT7SRLP Thanks again to Adgoji for sponsoring, it's helping me tremendously develop babashka, SCI, clj-kondo, etc.

jeroenvandijk13:02:58

Happy to hear that! We like all the things you are producing 🙂

jeroenvandijk13:02:25

Not enough time to try out all the things you are making :rolling_on_the_floor_laughing:

Benjamin15:02:24

is there a way either immediately finish a task or wait for another task to finish? Use case is having task a) depend on some data and the data can come either from user input or by querying stuff say task b). I always want to run task b) immediately sometimes a) needs to wait for it and sometimes it doesn't. I have an idea where I define some global promise of task b) output. Then a) can decide to deref that

borkdude15:02:32

@benjamin.schwerdtner That sounds like something you might want to do in user space, using promises or core.async

👍 1
borkdude15:02:03

E.g.:

(def result (promise))
(future (Thread/sleep 10000) (deliver result :from-future))
(future (Thread/sleep 1000) (deliver result :from-input))
@result ;;=> :from-input

1
Benjamin16:02:47

do you have an idea for a date picker "ui" using bb? I'm about to make in args or "args file" but maybe there is some shlick way

alexdavis16:02:20

you could use dialog https://makandracards.com/makandra/44334-open-dialogs-from-shell-scripts#section-example-date-picker or if you want really fancy you can use nbb and reagent components

dabrazhe20:02:36

Is there a way to run a bb task from the bb.edn in another folder?

borkdude20:02:45

@dennisa absolutely. bb --config the-other.bb.edn <task>

dabrazhe20:02:35

Is it supported in babashka v0.6.4? Getting Message: File does not exist: --config when running bb --config

borkdude20:02:00

no, recently added.

😁 1