-
Notifications
You must be signed in to change notification settings - Fork 326
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
IO.print without new line #10858
IO.print without new line #10858
Conversation
println : Any -> Nothing | ||
println message = @Builtin_Method "IO.println" | ||
println : Any -> Text -> Nothing | ||
println message nl='\n' = IO_Helpers.println message nl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please let's not use such shorthands in our public (1) API. I'd suggest to call this argument newline
or we could do similar to Python: end
or perhaps a more explicit end_with = '\n'
(I think I like end_with
the most, but that's just subjective).
Also the documentation should be updated to include the added argument in the Arguments:
section.
(1) The
PRIVATE
comment at the top may be confusing. It is used there to prevent a text-oriented method from showing up in the GUI's component browser. But theprintln
method is definitely part of our 'official' API and so it should be well documented for end-users. As already mentioned we probably should create a separate tag, likeTEXT_ONLY
orHIDDEN
, for documenting components that are not internal but should not show up in the GUI Component Browser.
distribution/lib/Standard/Base/0.0.0-dev/src/Internal/IO_Helpers.enso
Outdated
Show resolved
Hide resolved
My twopence: if |
36699e9
to
f089030
Compare
I agree. Why not have two methods - |
Fair point. I'd suggest that we keep This way we can keep using IMO separating into two functions would be clearest. And it's already done that way e.g. in Java, so people will be familiar with it. |
I agree with Adam. IMO the function should've been called |
The problem with Adam's rename to
As proposed by @radeusgd and voted up by @GregoryTravis, @hubertp and @Akirathan. I'll prepare the patch. |
CRLF failure on Windows will be fixed by 7e8feee |
Pull Request Description
Fixes #10028 by adding
IO.print
function that doesn't add new line at the end of its message.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.