<div class="gmail_quote">On Thu, Dec 2, 2010 at 21:41, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":2mm">I was thinking of something more outside of the usual C syntax. Something that the compiler ignores or does not see.</div></blockquote><div><br></div><div>Anything that the compiler ignores is by definition unchecked, so any desired conventions will be violated somewhere.  It would be possible to adopt an internal system for const-ness (e.g. const_Vec) which would end up typedef'd to plain Vec for non-library code so that users would not need adopt this weird system.  It's still weird.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div id=":2mm"> For example<br>
<br>
  Input Parameters:<br>
+  const mat - the factored matrix<br>
-  const b - the right-hand-side vector<br>
.  x - the result vector<br></div></blockquote><div><br></div><div>These annotations could be produced automatically if some typedefs were adopted.  Or you could just write these things into the man page and leave them unchecked, but that breeds inconsistencies.  (One way to fight complexity is to have the compiler (and function guards) check that the invariants I expect are actually enforced.  It is possible for this to get out of control and become its own complexity.)</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div id=":2mm">
Which brings up a different point, what does Input Parameters and Output Parameters: mean, at times we are inconsistent for MatMult() we have<br>
<br>
   Input Parameters:<br>
+  mat - the factored matrix<br>
-  b - the right-hand-side vector<br>
<br>
   Output Parameter:<br>
.  x - the result vector<br>
<br>
this kind of means that mat and b are const and x is not, but usually the Output Paramater is reserved for when an object is created and passed out (which I like better).</div></blockquote></div><br><div>Some documentation systems have an "in/out" attribute which indicates that you have to pass in something valid, and it will be returned modified.</div>
<div><br></div><div>Jed</div>