obb

rossputin 2022-01-21T20:30:04.006700Z

hey - another question I’m thinking about is how to pass data into a script via piping from a previous command - any pointers? Thanks!

zane 2022-01-21T20:31:00.007400Z

You’ll have to use interop for this as well for the time being.

borkdude 2022-01-21T20:31:31.007600Z

Maybe we can document what that interop looks like in examples/stdin.cljs

zane 2022-01-21T20:31:58.008Z

Yes. Good interim solution.

rossputin 2022-01-21T20:33:05.008300Z

no worries about the interop - recognise how new this project is and thanks so much for the pointers

borkdude 2022-01-21T20:33:50.008500Z

I'm actually interested in how to do this, since the answers on Stackoverflow look rather messy

rossputin 2022-01-21T20:34:55.008700Z

I admit I’ve been a little put off by some of the messiness on SO (hence my drift towards clojure world as much as possible)

zane 2022-01-21T20:36:24.008900Z

Yeah, the StackOverflow answers are the only solutions I’ve found so far.

zane 2022-01-21T20:36:30.009100Z

Would be delighted if there were a better way.

zane 2022-01-21T20:36:36.009300Z

I think we’ll probably have to go the ObjC route.

borkdude 2022-01-21T20:37:44.009500Z

maybe something like this works?

$ echo '1' | bb -e '(slurp "/dev/stdin")'
"1\n"

zane 2022-01-21T20:38:34.009700Z

Worth a shot!

borkdude 2022-01-21T20:39:36.009900Z

I'm not sure if that's a total hack and a bad idea

borkdude 2022-01-21T20:40:00.010100Z

but it seems to work :P

zane 2022-01-21T20:43:28.010300Z

Honestly, I think for a lot of stuff we’re going to need ObjC anyway, so we may as well do it that way.

zane 2022-01-21T20:43:49.010500Z

But hopefully that’ll unblock @rossajmcd!

👍 1
rossputin 2022-01-21T20:44:44.010700Z

will give it a go and thanks