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

Consider translating top-level echo as print/println #6

Open
dundalek opened this issue Jun 8, 2023 · 1 comment
Open

Consider translating top-level echo as print/println #6

dundalek opened this issue Jun 8, 2023 · 1 comment

Comments

@dundalek
Copy link

dundalek commented Jun 8, 2023

Printing with echo:

echo -n foo
echo bar

Gets translated as (which works correctly):

(shell "echo" "-n" "foo")
(shell "echo" "bar")

We could make the output for top-level echos (that are not part of a pipeline) a bit nicer and idiomatic if we translate them as:

(print "foo")
(println "bar")
@pesterhazy
Copy link
Owner

Hm, of course as you pointed out, the naive implementation doesn't work in pipe or command substitution contexts.

I'd like println to work in those contexts as well, but that'll require a bit more refactoring

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