sci

Ingy döt Net 2024-05-27T08:45:25.684449Z

When I try this

$ bb '(.toPath (io/file "xyz"))'
#object[sun.nio.fs.UnixPath 0x5210b532 "xyz"]
in ys (via SCI)
$ ys -Ce '(.toPath (io/file "xyz"))'
Error: Method toPath on class java.io.File not allowed!
from: https://github.com/babashka/sci/blob/bf6a0f1e00313a902c62c59e440266612725b926/src/sci/impl/evaluator.cljc#L152-L154 How do I config to allow these method calls?

borkdude 2024-05-27T08:46:02.636229Z

See babashka src/babashka/impl/classes.clj

👍 1
👀 1
Ingy döt Net 2024-05-27T14:01:50.967069Z

I'm getting

$ YS -e 'clj/for [i (range 1 6)]: println(i)' -p
Error: Method nth on class clojure.lang.LongRange$LongChunk not allowed!
where clj/for is interned macro from clojure.core/for clojure.lang.LongRange$LongChunk nth is defined here clojure.lang.LongRange$LongChunk Is this because the class is private? Is there a possible workaround?

Slackbot 2024-05-27T14:08:52.777989Z

This message was deleted.

borkdude 2024-05-27T14:09:22.592249Z

please use a thread for discussions about one and the same topic

borkdude 2024-05-27T14:10:16.373519Z

I don't know anything about YS, please submit a SCI-alone fully standalone and minimal repro

Ingy döt Net 2024-05-27T14:11:14.717819Z

(I'm trying to expose a ys.std/for that is an interned clojure.core/doseq and a clj/for that is an interned clojure.core/for )

Ingy döt Net 2024-05-27T14:12:00.053999Z

ok

borkdude 2024-05-27T14:13:14.632239Z

why aren't you using SCI's built-in for?

Ingy döt Net 2024-05-27T14:13:42.998759Z

I wasn't aware. Looking now.

borkdude 2024-05-27T14:20:31.700019Z

I mean, it's built-in, you don't even have to look for it?

Ingy döt Net 2024-05-27T14:26:31.220659Z

This one?:

$ bb -e "(resolve 'for)"
#'clojure.core/for

borkdude 2024-05-27T14:27:24.850309Z

What are you trying to do

Ingy döt Net 2024-05-27T14:29:30.693979Z

> Ingy döt Net [4:11 PM] > (I'm trying to expose a ys.std/for that is an interned clojure.core/doseq > and a clj/for that is an interned clojure.core/for ) If for is built into sci, I'm pretty sure that's what I'm using...

Ingy döt Net 2024-05-27T14:31:59.157329Z

https://github.com/yaml/yamlscript/blob/main/core/src/yamlscript/runtime.clj#L80 I can make a standalone sci repro if you'd like...

borkdude 2024-05-27T14:36:32.970469Z

yeah, standalone repro good

Ingy döt Net 2024-05-27T14:37:30.790959Z

It's from this rabbithole with @phill https://clojurians.slack.com/archives/C05HQFMTURF/p1716808881911529?thread_ts=1716133577.435449&cid=C05HQFMTURF It's not important because I think @phill is talking me out of it. But I'd be interested to know what's happening so I'll post it later, maybe. Thanks...

borkdude 2024-05-27T14:39:03.897069Z

sorry, no time to read all of that. I will read an issue + repro though

✅ 1