<div dir="ltr"><div class="gmail_default" style="font-family:'courier new',monospace"><span style="font-family:arial">2013/11/18 Mark Morgan Lloyd </span><span dir="ltr" style="font-family:arial"><<a href="mailto:markMLl.fpc-pascal@telemetry.co.uk" target="_blank">markMLl.fpc-pascal@telemetry.co.uk</a>></span></div>

<div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
There are definitely hazards, but I think that an exists() predicate of some form would definitely be useful. For example, inside an {$ifdef persist} it would give the developers the ability to have a tailored error message advising the maintainer that if persists.pas didn't exist he should also get such-and-such a project from local svn, and set up appropriate symlinks.<br>


<br>
The major issue would be directories and search paths.</blockquote><div><br></div><div class="gmail_default" style="font-family:'courier new',monospace">That's also what I want to achieve.  My original purpose is to reduce dependencies by put non-critical functions into a separate aux unit while make the main unit still workable without the aux unit.​​</div>

<div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style="font-family:'courier new',monospace">As to the search path, I would suggest searching the current path (which *this* unit resides in), plus the path defined in project options.  I also suggest to disable path component in this proposed directive, i.e.:</div>

<div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style="font-family:'courier new',monospace">{$ifexists some/relative/path/filename.pas} and</div>

<div class="gmail_default" style="font-family:'courier new',monospace">{$ifexists /some/absolute/path/filename.pas} <br></div><div class="gmail_default" style="font-family:'courier new',monospace"><br></div>

<div class="gmail_default" style="font-family:'courier new',monospace">are BOTH NOT allowed, only {$ifexists filename.pas} is allowed.</div><div class="gmail_default" style="font-family:'courier new',monospace">

<br></div><div class="gmail_default" style="font-family:'courier new',monospace">I don't know if this conforms to fpc traditions or not.</div><div class="gmail_default" style="font-family:'courier new',monospace">

<br></div><div class="gmail_default" style="font-family:'courier new',monospace">As to the concern about existing ppu or .o file, I think it is not a problem, because you just follow the normal rule to compare file datetime of the .o and .pas file. I don't like to rely on make files as fpc has its own building system.</div>

<div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style="font-family:'courier new',monospace">Xiangrong</div></div></div></div>