Fork me on GitHub
#squint
<
2024-03-21
>
onetom20:03:10

I just tried Object.assign(globalThis, _sc) in the squint/index.umd.html and it seems to work quite nicely from the devtools console. This way I can write clojure programs in js syntax on a live webpage, without any browser extensions. I've checked if there are any conflicts between the browser globals and the vars in squint.core:

new Set(Object.keys(_sc)).intersection(new Set(Object.keys(globalThis)))
> Set(1) {'find'}
i wonder if it would cause any practical issues if we override that find function...

onetom20:03:33

I've also noticed there is a globalThis.name property, but there is no squint.core.name in https://cdn.jsdelivr.net/npm/[email protected]/lib/squint.core.umd.js, yet https://squint-cljs.github.io/squint can correctly run (-> js/globalThis type name) and it compiles it to

var squint_core = await import("squint-cljs/core.js");
globalThis.user = globalThis.user || {};
return name(squint_core.type(globalThis));
i wonder why can't i access _sc.name on the index.umd.html page (with squint 0.7.96 in it)?

borkdude21:03:18

I don't know why this works, but apparently it does https://squint-cljs.github.io/squint/?src=KG5hbWUgOmZvbyk%3D name isn't a squint function yet