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: Names in libguile


Maciej Stachowiak <mjs@eazel.com> writes:

> > Certainly _P is simpler, but then, Helvetica is simpler and more
> > consistent than Times Roman and the latter is much more readable in
> > the long run.
> > 
> > Code should be pretty and easy to read, not only simple and
> > consistent.  (Besides, the _P/P *is* 100% consistent, just a little
> > bit complex.)
> 
> I think it would still be nice for macro names to be consistent with
> function names. In any case, I don't see why SCM_NULLP is supposed to
> be a gain in readability above SCM_NULL_P, but scm_nullp is inferior
> to scm_null_p.

I claim that the CLTL2-style is more readable regardless if it
concerns a Scheme/Lisp name, a C function name, or a C macro name.

Compare

  do
    {
      if (SCM_NULLP (hare))
        return result;
      SCM_ASSERT (SCM_CONSP (hare), lst, 1, FUNC_NAME);
      result = scm_cons (SCM_CAR (hare), result);
      hare = SCM_CDR (hare);
      if (SCM_NULLP (hare))
        return result;
      SCM_ASSERT (SCM_CONSP (hare), lst, 1, FUNC_NAME);
      result = scm_cons (SCM_CAR (hare), result);
      hare = SCM_CDR (hare);
      tortoise = SCM_CDR (tortoise);
    }
  while (hare != tortoise);

to

  do
    {
      if (SCM_NULL_P (hare))
        return result;
      SCM_ASSERT (SCM_CONS_P (hare), lst, 1, FUNC_NAME);
      result = scm_cons (SCM_CAR (hare), result);
      hare = SCM_CDR (hare);
      if (SCM_NULL_P (hare))
        return result;
      SCM_ASSERT (SCM_CONS_P (hare), lst, 1, FUNC_NAME);
      result = scm_cons (SCM_CAR (hare), result);
      hare = SCM_CDR (hare);
      tortoise = SCM_CDR (tortoise);
    }
  while (hare != tortoise);

But since the translation between Scheme primitive names and C
function names sometimes needs to be automatized, it is preferable to
have the simpler naming scheme there.  I don't see the differing
conventions used so far as a problem, but an advantage.

But if people want to use the same convention in both cases, this is
something I can understand.

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