This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Scwm docstrings change


Clark McGrew <mcgrew@ale.physics.sunysb.edu> writes:

> Hello,
> 
> Greg J. Badros suggests:
> 
> > SCM_PROC(foo_proc,"foo-proc",1,0,0, (SCM bar),
> > 	 "Documentation for foo_proc")
> > {
> > 	/* Function body .... */
> > }
> 
> 
> Please don't use macro's to change the syntax of C.  That's great for
> the person who wrote and developed the system, but it severely
> decreases the readability of the code.  

No, it doesn't.  All you have to do is learn the syntax once and then it 
is not a problem.  If anything keeping tightly-coupled things separate
decreases the readability since the connections are less obvious.

<snip>

As yet another point, there is plenty of prior art in doing exactly
this.  Both Emacs and Sawmill do use macros that expand into function
headers.  Scwm obviously does as well.  It's a common technique in the
conventions of interpreters.  See my papers on this stuff at

http://www.cs.washington.edu/homes/gjb/#papers

(e.g., An Empirical Analaysis of C Preprocessor Use and A Framework for
Preprocessor-Aware C Source Code Analyses).  I've a lot of experience
with the headaches and pains that macros can cause programmers and
tools, yet here I'm absolutely convinced that the benefits far outweigh
those costs.  The use of the macros will be highly structured and
regular, and they will help enforce some important source code
invariants while also making the inter-dependencies between registering
the function and the function header more obvious and inseparable (as
they should be since they are very tightly coupled).

Greg

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]