You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Karl Fogel <kf...@red-bean.com> on 2008/03/01 00:46:54 UTC

Re: svn commit: r29617 - trunk/subversion/svn

"David Glasser" <gl...@davidglasser.net> writes:
> You can't do this in the definition itself, I think (after all, gotta
> name them variables), but you could (for static functions, say) insert
> a declaration immediately before the declaration:
>
> static svn_foo_func_t best_foo_ever;
> static svn_error_t
> best_foo_ever(svn_foo_t x, apr_pool_t *y)
> {
> }

Yeah.  That's sort of like remembering to write the comment (which
we're supposed to do already, but sometimes forget) saying "/* This
implements the svn_foo interface. */".

But still, having the type in the header file is an improvement, and
using an actual type-check is no harder to remember than a comment,
for static functions.

+1

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r29617 - trunk/subversion/svn

Posted by David Glasser <gl...@davidglasser.net>.
On Fri, Feb 29, 2008 at 4:46 PM, Karl Fogel <kf...@red-bean.com> wrote:
> "David Glasser" <gl...@davidglasser.net> writes:
>
> > You can't do this in the definition itself, I think (after all, gotta
>  > name them variables), but you could (for static functions, say) insert
>  > a declaration immediately before the declaration:
>  >
>  > static svn_foo_func_t best_foo_ever;
>  > static svn_error_t
>  > best_foo_ever(svn_foo_t x, apr_pool_t *y)
>  > {
>  > }
>
>  Yeah.  That's sort of like remembering to write the comment (which
>  we're supposed to do already, but sometimes forget) saying "/* This
>  implements the svn_foo interface. */".

Yeah.  And on quite a few occasions I've seen that comment be there...
and remain there unchanged when the function is updated to implement
the svn_foo2 interface.

>  But still, having the type in the header file is an improvement, and
>  using an actual type-check is no harder to remember than a comment,
>  for static functions.

I think for static functions there's no question.  For header files,
I'm not as positive, since it might be frustrating to not have the
argument list right there.  (I guess we could do both.)

--dave

>
>  +1
>
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
>  For additional commands, e-mail: dev-help@subversion.tigris.org
>
>



-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org