Fork me on GitHub
#sci
<
2022-05-13
>
devn16:05:46

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?

borkdude17:05:58

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

devn17:05:41

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

borkdude17:05:18

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

devn17:05:00

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

devn17:05:20

is that any clearer? 🙂

borkdude17:05:07

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

borkdude17:05:32

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

devn20:05:11

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]"

borkdude20:05:39

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

borkdude20:05:51

what kind of REPL?

devn20:05:57

cider nrepl

borkdude20:05:06

maybe a CIDER feature then

borkdude20:05:13

try a bare clj REPL

devn20:05:05

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