<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Oct 30, 2013 at 1:35 PM, Marcos Douglas <span dir="ltr"><<a href="mailto:md@delfire.net" target="_blank">md@delfire.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
IMO, the problem is:<br>
You can not use two unit with the same name.<br>
So, you can point -- using -Fu -- which unit the compiler will compile<br>
but you can't used both at the same project.<br>
</blockquote><div><br>I guess, technically it should be possible to use two different units with the same name.<br><br></div><div>I recall there was a discussion a while (few years) ago, about (re)using Delphi introduced 'in' syntax (afaik, it is not available in pascal).<br>
</div><div>uses<br></div><div> unitA in 'unitA.pas'<br></div><div> ,unitAA in '.\some\other\place\unitA.pas'<br></div><div>Don't remember what was the conclusion of the conversation.<br></div><div>Yet again, this "in" solution is only allowed at either "program" or "library" units.<br>
</div><div><br></div><div>But from the compiler's perspective, if there're two units with the same name, it would need to solve two problems:<br></div><div>1) decide the rules on what units are using what unit of these 2. (That's why it was proposed to introduce an extension to -Fu or some other switch)<br>
</div><div>2) decide about the "object name" for each unit. "UnitA" for the first unit and "UnitA_1" for the second one (taking into consideartion that there's no UnitA_1.pas file used)<br>
</div><div>Linker is not using an "hierarchy" of files, so each object file should be using a unique name.<br><br></div><div>It should not be a problem for compiler to do that, unless "precompiled" object files are used.<br>
</div><div>Since actual object file name collides, then it just won't work, unless object file itself is modified to produce unique names.<br></div><div> </div><div>thanks,<br>Dmitry<br></div></div></div></div>