ok I was talking about user code. To also make it work with phobos, it would also have to be recompiled (recompiling just phobos is fast anyways); the simplest would be the following:
A) user defines an environment variable PHOBOS_INC (which defaults to -I$phobos_root but can be overridden for example by -I$phobos_root/experimental -I$phobos_root). B) $phobos_root/posix.mak (+ windows makefiles) is improved to support reading in $PHOBOS_INC currently we have: STD_MODULES = $(addprefix std/, algorithm array process ...) we should instead use $PHOBOS_INC to follow the same logic as dmd would, ie use the first module that comes on the import path and avoid duplication. Actually I suggested somewhere else to rewrite phobos's makefile by a simpler makefile written in D. That would make this easy. On Mon, Apr 15, 2013 at 10:13 AM, Steven Schveighoffer <[email protected]> wrote: > On Mon, 15 Apr 2013 13:03:07 -0400, Andrej Mitrovic > <[email protected]> wrote: > >> On 4/15/13, Timothee Cour <[email protected]> wrote: >>>> >>>> How does that work if both modules are std.process? Wouldn't there be a >>>> link error? >>> >>> >>> There won't be a 'duplicate symbol definition', instead, dmd will find >>> the first file on the import path that defines a module std.process. >> >> >> Phobos comes as a prebuilt static library, which DMD uses. But Phobos >> can't be built entirely as a static library if there are two modules >> with the same name. > > > Yes, that was my question, the library will define two std.process. What > would happen? > > -Steve
