<div dir="ltr">On Mon, Jan 7, 2013 at 5:42 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><div class="gmail_extra"><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"><br>
On Jan 7, 2013, at 5:28 PM, Jed Brown <<a href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>> wrote:<br>
<br>
> On Mon, Jan 7, 2013 at 3:29 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:<br>
> The PetscOptions and PetscInfo functions are examples where we used _Private to<br>
> indicate a lower level interface, rather than one that was truly file scope. I guess we<br>
> need two different specifiers.<br>
><br>
> Most of these are in matimpl.h and vecimpl.h. They should perhaps be called _Internal since they are shared inside PETSc, but not public. We should also change them from PETSC_EXTERN so that we can set visibility=hidden to prevent users from calling them through shared libraries. ;-)<br>

<br>
</div>   I have no problem making them _Internal instead of _Private if that is clearer. And making them not PETSC_EXTERN<br>
<div class="im"><br>
><br>
> I don't have a problem with non-namespaced functions at file local scope,<br>
<br>
</div>    I do have a problem with them, because I read code I haven't seen before (that Jed or someone who copied Jed wrote) that looks like<br>
<br>
     PetscCoolClassAFunction(PetscSomething, ….) {<br>
       …..<br>
       PetscStrcpy().<br>
       SomenameofSomething().<br>
       ISCreate…()<br>
     }<br>
<br>
     and I don't know if SomenameofSomething is private to this file or from some other package. (note many other packages don't namespace so I cannot tell if it is some other package). This interrupts the flow of the understanding of the code so I need to restart (having to jump to somewhere else in the file to see if SomenameofSomething() is in the file and a local utility. I would prefer<br>

<br>
     PetscCoolClassAFunction(PetscSomething, ….) {<br>
       …..<br>
       PetscStrcpy().<br>
       PetscCoolClassSomething_Static().<br>
       ISCreate…()<br>
     }<br>
<br>
now I immediately know it is a utility function associated with the PetscCoolClass and it is also static (so private to the file). I can keep on reading.<br>
<br>
Just making up random names (no mater how local) is not good literate programming :-)<br>
<br>
So we are proposing utility functions in PETSc NOT for external users are PetscClassFunction_Internal() and for static functions in a file are PetscClassFunction_Static()?<br></blockquote><div><br></div><div style>I would prefer _Internal and _Private just because I think it sounds better.</div>
<div style><br></div><div style>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  Barry<br>
<br>
Yes I realize the static is redundant with the declaration of the function but I am not reading the declaration I am reading the use and don't want to interupt the flow by jumping around.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
<br>
> they just have to be renamed if they are ever referenced from elsewhere.<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener
</div></div>