sci

henrik42 2023-06-11T21:42:33.807949Z

Hey! sci/scittle newbie here. Does SCI offer loading CLJS urls dynamically? I'm using https://tryclojure.org/ and would like to load CLJS code from gists.

borkdude 2023-06-11T21:43:35.126569Z

SCI doesn't implement loading stuff from external sources, but it offers a hook called :load-fn (synchronous) or :async-load-fn when you are using sci.async

henrik42 2023-06-11T21:54:21.032209Z

This means - as far as I understand - that the maintainer/owner of tryclojure would have to supply this hook. There is no way for me as an enduser to set this.

borkdude 2023-06-11T21:55:24.185099Z

correct

borkdude 2023-06-11T21:55:52.259929Z

well, you could load the code from a gist can just call load-string on it

borkdude 2023-06-11T21:55:59.885589Z

you can do this using JS interop perhaps

henrik42 2023-06-11T21:57:17.922119Z

I came up with this bizar hack (idea is to reuse scittle), but then scittle and the "hosting" sci do not see the same namespaces.

borkdude 2023-06-11T21:57:46.977329Z

correct, you can't mix two separate SCI projects

👍 1
henrik42 2023-06-11T21:58:11.161669Z

Thx

borkdude 2023-06-11T21:58:12.373099Z

just make an request and call load-string on the result, worth a shot

henrik42 2023-06-11T21:58:55.333049Z

Will do. Thanks a lot.