On Thu, Aug 11, 2011 at 5:28 PM, Alan W. Irwin <span dir="ltr">&lt;<a href="mailto:irwin@beluga.phys.uvic.ca">irwin@beluga.phys.uvic.ca</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 2011-08-11 16:46-0400 David Cole wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I share Alex&#39;s confusion with your proposed signature. All other string subcommands refer to either &quot;&lt;string&gt;&quot; or &quot;&lt;input&gt;&quot; in their args<br>
list. None of them have both &quot;&lt;string&gt;&quot; *and* &quot;&lt;input&gt;&quot;.<br>
</blockquote>
<br></div>
Sorry I should have been more explicit.  The current signatures for<br>
REGEX et al are<br>
<br>
string(REGEX MATCH &lt;regular_expression&gt;<br>
      &lt;output variable&gt; &lt;input&gt; [&lt;input&gt;...])<br>
string(REGEX MATCHALL &lt;regular_expression&gt;<br>
       &lt;output variable&gt; &lt;input&gt; [&lt;input&gt;...])<div class="im"><br>
string(REGEX REPLACE &lt;regular_expression&gt;<br>
       &lt;replace_expression&gt; &lt;output variable&gt;<br></div>
       &lt;input&gt; [&lt;input&gt;...])<br>
string(REPLACE &lt;match_string&gt;<br>
       &lt;replace_string&gt; &lt;output variable&gt;<br>
       &lt;input&gt; [&lt;input&gt;...])<br>
<br>
What I am suggesting for all of them is to make &lt;input&gt; [&lt;input&gt;...])<br>
optional.  When that is not supplied, the input would be taken<br>
from &quot;${&lt;output variable&gt;}&quot; instead.  And similarly for<br>
<br>
string(APPEND or CONCAT &quot;&lt;string&gt;&quot; &lt;output variable&gt;<br>
       &lt;input&gt; [&lt;input&gt;...])<br>
<br>
Hope that makes clear what I am proposing.<div><div></div><div class="h5"><br>
<br>
Alan<br>
__________________________<br>
Alan W. Irwin<br>
<br>
Astronomical research affiliation with Department of Physics and Astronomy,<br>
University of Victoria (<a href="http://astrowww.phys.uvic.ca" target="_blank">astrowww.phys.uvic.ca</a>).<br>
<br>
Programming affiliations with the FreeEOS equation-of-state implementation<br>
for stellar interiors (<a href="http://freeeos.sf.net" target="_blank">freeeos.sf.net</a>); PLplot scientific plotting software<br>
package (<a href="http://plplot.org" target="_blank">plplot.org</a>); the libLASi project (<a href="http://unifont.org/lasi" target="_blank">unifont.org/lasi</a>); the Loads of<br>
Linux Links project (<a href="http://loll.sf.net" target="_blank">loll.sf.net</a>); and the Linux Brochure Project<br>
(<a href="http://lbproject.sf.net" target="_blank">lbproject.sf.net</a>).<br>
__________________________<br>
<br>
Linux-powered Science<br>
__________________________<br>
</div></div></blockquote></div><br><div>It&#39;s clear what you mean with the REGEX signatures, but I disagree about the optional nature of at least one input.</div><div><br></div><div>In my experience, the lack of an input to one of these signatures usually means there&#39;s a typo in a dereferenced variable name, or the variable is unexpectedly empty.</div>
<div><br></div><div>It may or may not be the same as the output variable... but I think it&#39;s a good thing when you get a CMake error in such a case, as is the case now. I hesitate to stop generating that error.</div><div>
<br></div><div>So I&#39;m voting no on this proposal as well...</div><div><br></div>