Fork me on GitHub
#babashka
<
2019-10-23
>
borkdude08:10:41

@dominicm the way I currently enable "interop" is by creating bindings like (.foo x) where foo is a normal function which is set to #(.foo ^TheClass %)

borkdude08:10:13

in babashka this works for a selection of classes

dominicm08:10:28

ah, so I could steal that code.

dominicm08:10:43

Do you pre-process the code in bbka by reading it?

borkdude08:10:59

not sure what you mean

borkdude08:10:09

what is your use case btw?

dominicm08:10:20

usually I would generate this in edn using aero or something

borkdude08:10:01

the code is read using edamame which is configurable so it can read "normal" Clojure code: https://github.com/borkdude/edamame

borkdude08:10:08

you can see how it's used in sci.impl.parser

borkdude08:10:31

you cannot just put any code in EDN and read it with the normal EDN readers

dominicm08:10:34

I know, but that's okay for me

dominicm09:10:53

I want edamame to be a user decision, rather than a high requirement.

dominicm09:10:31

@borkdude can you point me at where you convert .foo to #()?

dominicm09:10:55

How does babashka/sci know to route to this thing? Does it look at the metadata annotation? anyway, don't think this will work for me because I want to work with user-supplied memfns.

borkdude09:10:58

note that these bindings are not something the user can control

borkdude09:10:12

unless they're using sci as a lib of course

dominicm09:10:21

total aside, babashka makes me think of https://en.wikipedia.org/wiki/Baba_Yaga 🙂

dominicm09:10:31

(I think they share a word root?)

borkdude09:10:11

haha awesome. yeah, babushka means granny in Russian

borkdude09:10:01

babashka (with an a) also means a thing in Russian: it's an iron bar to connect spaces between words in typography

borkdude09:10:25

of course I knew all of this when coming up with this name

dominicm09:10:43

Oh, I tried googling babashka and didn't get anything except "granny" and pictures of you 🙂

dominicm09:10:06

> Baba Yaga flies around in a mortar, wields a pestle, and dwells deep in the forest in a hut usually described as standing on chicken legs. baba yaga is quite entertaining to picture 🙂