sci

devn 2022-05-13T16:58:46.613709Z

something i can’t explain: somehow during a full run of sexps, something like the following (pr-str (sci/eval-string "(completing conj count)")) which returns "#function[clojure.core/completing/fn--8528]" , begins returning "#object[clojure.core$completing$fn__8528 0x2f2a24dc \"clojure.core$completing$fn__8528@2f2a24dc\"]" and my gut is telling me that this is some kind of host access scenario, but i cannot track it down. any ideas?

borkdude 2022-05-13T17:11:58.483109Z

@devn SCI re-uses the clojure core functions, that's what you are seeing here, the printed version of a function in completing

devn 2022-05-13T17:17:41.001169Z

hmm, i think i’m still missing something/am not following. i can’t seem to produce that #object… string in my code

borkdude 2022-05-13T17:22:18.905869Z

@devn can you maybe dumb down the problem for me?

devn 2022-05-13T17:34:00.953899Z

im having trouble understanding how #object[...] shows up in these strings when something like (pr-str (sci/eval-string "(comp)")) produces "#function[…]" .

devn 2022-05-13T17:38:20.862679Z

is that any clearer? 🙂

borkdude 2022-05-13T17:41:07.191639Z

No, can you spell it out more explicit? Please code as if I'm starting my editor from scratch

borkdude 2022-05-13T17:44:32.779419Z

What you are seeing is just functions / closures being printed - what else do you expect?

devn 2022-05-13T20:16:11.908819Z

sorry, had to step away. i’m totally failing at understanding this/providing a code example to demonstrate. maybe this is a more fundamental clojure question. what causes it to be printed as #object[…]? when i run a function via lein run -m foo.core, they look like "#object[sci.impl.fns$fun$arity_1__26730 0x41167e79 \"sci.impl.fns$fun$arity_1__26730@41167e79\"]" . if I run it from a repl they look like "#function[sci.impl.fns/fun/arity-1--33946]"

borkdude 2022-05-13T20:17:39.111749Z

don't know, maybe a print-method on IFn or so?

borkdude 2022-05-13T20:17:51.709469Z

what kind of REPL?

devn 2022-05-13T20:17:57.961139Z

cider nrepl

borkdude 2022-05-13T20:18:06.506059Z

maybe a CIDER feature then

borkdude 2022-05-13T20:18:13.156899Z

try a bare clj REPL

devn 2022-05-13T20:20:05.527609Z

took me a lot of banging my head against the wall to finally narrow it down to REPL v not: https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/print_method.clj#L12