sci

mkvlr 2022-02-19T12:14:23.863499Z

it seems that sci when targeting the browser, unlike ClojureScript, doesn’t create plain js functions when using fn , is that correct? Can I access the underlying fn if I need to pass it to a js lib as a callback?

borkdude 2022-02-19T12:14:52.915409Z

@mkvlr it does return plain functions like CLJS, or at least, it should

mkvlr 2022-02-19T12:15:34.437759Z

hmm, does location metadata change that potentially?

borkdude 2022-02-19T12:16:19.918779Z

potentially yes, since MetaFns aren't normal JS functions

mkvlr 2022-02-19T12:16:20.653429Z

shows up like this

mkvlr 2022-02-19T12:16:31.693169Z

and is of type MetaFn

borkdude 2022-02-19T12:16:34.490149Z

but defaults in SCI will take care of this, unless you use custom

borkdude 2022-02-19T12:16:52.079879Z

Check scittle, nbb, etc: those all work correctly with JS interop

borkdude 2022-02-19T12:17:05.273609Z

what config are you using for SCI?

mkvlr 2022-02-19T12:18:13.750939Z

guess I can turn off this for edamame and that should do it then

borkdude 2022-02-21T09:51:57.132059Z

👋

borkdude 2022-02-19T12:18:38.373499Z

turn what off?

mkvlr 2022-02-19T12:18:58.284299Z

attaching location metadata?

borkdude 2022-02-19T12:19:24.036109Z

I think edamame should have an option to read using clojure defaults. in the beginning I made the mistake of using different keywords for rows and columns. SCI itself has fixed this, but I would prefer to fix this in edamame, but this would be breaking :(

borkdude 2022-02-19T12:19:51.701229Z

but if you use :row-key :line :col-key :column it should already work

borkdude 2022-02-19T12:20:01.584689Z

since those are stripped before attaching metadata to a function

borkdude 2022-02-19T12:21:04.974689Z

that js namespace is no longer used

borkdude 2022-02-19T12:21:10.973849Z

I should really remove it

borkdude 2022-02-19T12:21:34.353349Z

just use the settings I recommend earlier

borkdude 2022-02-19T12:21:37.776719Z

and then it should work

borkdude 2022-02-19T12:21:56.841449Z

or read using SCI's reader

borkdude 2022-02-19T12:22:01.378469Z

which is also exposed

borkdude 2022-02-19T12:22:11.485269Z

you can add additional edamame options to it

mkvlr 2022-02-19T12:23:13.912049Z

yeah those settings work, thanks!

🙌 1
borkdude 2022-02-19T12:23:44.111869Z

I really wish I could change this in edamame itself

mkvlr 2022-02-19T12:23:53.698849Z

:location? seq? also doens’t hurt I guess?

borkdude 2022-02-19T12:24:00.219099Z

yeah

borkdude 2022-02-19T12:24:14.292499Z

that's also the clojure default

borkdude 2022-02-19T12:24:23.929129Z

maybe I can introduce a :clojure-defaults true option

borkdude 2022-02-19T12:24:28.421589Z

which will do those things

borkdude 2022-02-19T12:24:40.500649Z

SCI still adds metadata to symbols when reading code, but I also want to get rid of that

👍 1
mkvlr 2022-02-19T12:25:21.569289Z

and :end-location false also recommended?

borkdude 2022-02-19T12:25:46.425959Z

if you're not using that, then it's good

mkvlr 2022-02-19T12:32:21.993339Z

borkdude 2022-02-19T12:32:50.441919Z

Oh very nice!

mkvlr 2022-02-19T12:35:14.117569Z

btw some interesting things came up with Clerk’s sci forms inside clojure namespaces… Wondering if we can support #js in quoted forms

borkdude 2022-02-19T12:35:55.009279Z

you can change the reader function for #js I think

mkvlr 2022-02-19T12:35:56.457769Z

did you do anything to applied-science.js-interop to work in sci? Tried sci/copy-ns earlier but it chocked

borkdude 2022-02-19T12:36:20.371989Z

check nbb which has a SCI config for it. copy-ns chokes on protocols and maybe other stuff

borkdude 2022-02-19T12:36:26.936479Z

you can :exclude those

mkvlr 2022-02-19T12:36:30.259719Z

will do, thanks

mkvlr 2022-02-19T12:36:40.337919Z

but macros should work normally?

borkdude 2022-02-19T12:36:56.038669Z

maybe I can work on that monday if you need help

borkdude 2022-02-19T12:37:12.153209Z

it depends on how those macros are defined

mkvlr 2022-02-19T12:37:22.277639Z

sure, that’d be great

borkdude 2022-02-19T15:55:16.967339Z

@mkvlr perhaps already make an issue so I can start on it Monday morning