www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18448] New: Make std.file.write / std.stdio.write conflicts


          Issue ID: 18448
           Summary: Make std.file.write / std.stdio.write conflicts more
                    tractable for beginners
           Product: D
           Version: D2
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: greensunny12 gmail.com

It's a common gotcha for newcomers that std.file.write and std.stdio.write
conflict with each other when used.

Of course, this can be trivially resolved with various of tricks (selective
imports, renamed imports, static imports etc.), but with the upcoming
std.experimental.scripting package (and eventually `import std`), this problem
will occur more and more to newcomers.

However, I'm not sure on a good way to proceed here.
std.file.write is too popularly used to be deprecated, but I put this into the
issue tracker because I think this will pop up more and more. If there's no
actionable, at least the documentation should be improved. It's rather short at
the moment [1].
Heck this is such a popular problem that we even could think to include a
special error message into the compiler ...

See also: 12368


[1] https://dlang.org/phobos/std_file.html#.write

Feb 15 2018