www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12368] New: std.file.write conflicts with std.stdio.write

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12368

           Summary: std.file.write conflicts with std.stdio.write
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: thecybershadow gmail.com



08:00:19 EET ---
import std.stdio, std.file;
string s, fn;
write(fn, s);

I think there should be a writeFile alias to avoid this conflict.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 14 2014
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12368


Vladimir Panteleev <thecybershadow gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



08:02:31 EET ---
https://github.com/D-Programming-Language/phobos/pull/2011

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 14 2014
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12368


Jakob Ovrum <jakobovrum gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jakobovrum gmail.com
         Resolution|                            |INVALID



---

 import std.stdio, std.file;
 string s, fn;
 write(fn, s);
 
 I think there should be a writeFile alias to avoid this conflict.
There's a ton of these in Phobos (another common example is `copy`), and they're not a problem due to how the module system works. Your example is correctly an error. It's up to the user to disambiguate - the user has a ton of options in doing so, including: 1 ---- import std.stdio; static import std.file; string s, fn; write(fn, s); std.file.write(fn, s); ------ 2 ---- import std.stdio; import file = std.file; string s, fn; write(fn, s); file.write(fn, s); ------ 3 ---- import std.stdio : stdoutWrite = write; import std.file : fileWrite = write; string s, fn; stdoutWrite(fn, s); fileWrite(fn, s); ------ 4 ---- import std.stdio; void func() { import std.file; string s, fn; .write(fn, s); write(fn, s); } ----- The list goes on forever. Closing this because this is by design - if you still have a problem with that design, it would need some serious convincing on the NG to warrant any changes. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 15 2014