Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'$' macro does not work in '->' #52

Closed
carlzhc opened this issue Dec 4, 2021 · 6 comments
Closed

'$' macro does not work in '->' #52

carlzhc opened this issue Dec 4, 2021 · 6 comments

Comments

@carlzhc
Copy link

carlzhc commented Dec 4, 2021

It seems $ macro only work in one command execution, not pipelined (tested in bb).

user=> (-> ($ echo hello) ($ sed p) deref :out slurp println)
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: No method in multimethod 'do-copy' for dispatch value: [java.lang.ProcessImpl$ProcessPipeInputStream java.lang.ProcessImpl$ProcessPipeInputStream] [at <repl>:13:1]

user=> (-> (process '[echo hello]) (process '[sed p]) deref :out slurp println)
hello
hello
@carlzhc
Copy link
Author

carlzhc commented Dec 4, 2021

Seems $ does not work in piping at all.

@carlzhc carlzhc closed this as completed Dec 4, 2021
@borkdude
Copy link
Contributor

borkdude commented Dec 4, 2021

@carlzhc Should it? We can try to fix it. But since you closed this, you might not be interested in it anymore?

@borkdude
Copy link
Contributor

borkdude commented Dec 4, 2021

I think it was supposed to work, but something may have been broken recently when we added support for passing options in the first position instead of via metadata..

(if (:proc fcmd#)

@borkdude borkdude reopened this Dec 4, 2021
@borkdude
Copy link
Contributor

borkdude commented Dec 4, 2021

You know what, I undocumented $ and made it deprecated. I think it's more trouble/magic than it's worth.

@borkdude borkdude closed this as completed Dec 4, 2021
@carlzhc
Copy link
Author

carlzhc commented Dec 6, 2021

Actually, I found the '$' does not support piping at all.
The first argument is supposed to be an option map to the command, not a previous command record as in 'process'.

@borkdude borkdude reopened this Dec 29, 2021
borkdude added a commit that referenced this issue Dec 29, 2021
@borkdude
Copy link
Contributor

I've looked into this more and the fix wasn't so difficult. I decided to undeprecate $.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants