Fork me on GitHub
#sci
<
2024-05-27
>
Ingy döt Net08:05:25

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?

borkdude08:05:02

See babashka src/babashka/impl/classes.clj

👀 1
👍 1
Ingy döt Net14:05:50

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?

Ingy döt Net14:05:52

(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 )

borkdude14:05:22

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

borkdude14:05:16

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

Ingy döt Net14:05:14

(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 )

borkdude14:05:14

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

Ingy döt Net14:05:42

I wasn't aware. Looking now.

borkdude14:05:31

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

Ingy döt Net14:05:31

This one?:

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

borkdude14:05:24

What are you trying to do

Ingy döt Net14:05:30

> 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...

borkdude14:05:32

yeah, standalone repro good

Ingy döt Net14:05:30

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

borkdude14:05:03

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

1