-
Notifications
You must be signed in to change notification settings - Fork 35
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
echo() always prints new line #374
Comments
Since ABS is in some sense "a better Bash", how about adding a flag to
|
We already have n args to echo eg. |
Ah, missed that, still mulling over improvements to https://www.abs-lang.org/types/function. I still stand by my recommendation, and further recommend that the
be carved out into a separate
|
Can you elaborate on why adding another function is annoying?
Might be a good option. What do you think? |
I'm aligned with your other option, but I'm skeptical that we should have a different function as I don't think it's a good DX. The problem with not printing new lines by default is that it would have to be a major release... |
python has I feel like most people are expecting a new line, especially with a command that shares the same name in BASH. It would be good to have the same default behavior I would think... would something like this be possible?
I guess everything is string type so maybe this wouldn't really be possible to differentiate within the echo function..... it should probably be a separate function if ABS doesn't have keyword arguments |
If the parameter is one, a newline is automatically appended. echo("foo") # `foo\n` // a newline
echo("%s".fmt("foo")) # `foo\n` // a newline
echo("%s", "%s".fmt("foo")) # `foo` // no newline
echo("%s", "foo") # `foo` // no newline |
We have 2 choices:
I'm leaning towards a print fn.
The text was updated successfully, but these errors were encountered: