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

writeln should be @nogc #9790

Open
dlangBugzillaToGithub opened this issue Mar 10, 2020 · 3 comments
Open

writeln should be @nogc #9790

dlangBugzillaToGithub opened this issue Mar 10, 2020 · 3 comments

Comments

@dlangBugzillaToGithub
Copy link

turkeyman reported this on 2020-03-10T17:23:28Z

Transfered from https://issues.dlang.org/show_bug.cgi?id=20663

CC List

  • destructionator

Description

I have had multiple complain (one of them *phoned me from overseas*) that writeln() doesn't work in @nogc.

Their claim goes: "How can it be acceptable that writeln() doesn't work in @nogc? It's literally the first thing you try and do!"

I have to agree. writeln() really should work everywhere, always.
@dlangBugzillaToGithub
Copy link
Author

destructionator commented on 2020-03-10T17:44:15Z

Whatever happened to that dip 1008 thing?

Or perhaps we could just change the invalid utf 8 sequence exception to the replacement char. I'd personally argue that is more useful for writing anyway (I often cast stuff to byte for it)

@dlangBugzillaToGithub
Copy link
Author

turkeyman commented on 2020-03-10T19:23:21Z

Dunno what's going on with DIP1008, but I actually agree that using the replacement char is actually the more interesting and useful thing to do.

I might be interested in throwing a UTF exception from a function like `validateString`, but I don't want writeln to throw! I want it to write text to the output stream... it has one job!

@dlangBugzillaToGithub
Copy link
Author

destructionator commented on 2020-03-10T19:36:32Z

hmmm took a look at the code and the other thing that throws is on fwrite errors. I forgot about those... could possibly throw a static instance or something but that complicates the easy idea of just using replacement char.

@LightBender LightBender removed the P4 label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants