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?See babashka src/babashka/impl/classes.clj
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?This message was deleted.
please use a thread for discussions about one and the same topic
I don't know anything about YS, please submit a SCI-alone fully standalone and minimal repro
(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 )
ok
why aren't you using SCI's built-in for?
I wasn't aware. Looking now.
I mean, it's built-in, you don't even have to look for it?
This one?:
$ bb -e "(resolve 'for)"
#'clojure.core/for
What are you trying to do
> 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...
https://github.com/yaml/yamlscript/blob/main/core/src/yamlscript/runtime.clj#L80 I can make a standalone sci repro if you'd like...
yeah, standalone repro good
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...
sorry, no time to read all of that. I will read an issue + repro though