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: [PATCH] scsh block comment fix + small speedup


Chris Cramer <crayc@kiwi.pyro.net> writes:

> OK, I looked up the scsh manual, it says block comments start with
> #! and end with !# on a line by itself.

I'm not sure whether we should recommend block comments in general.  I
find the normal ;; comments to be quite workable with Emacs support.

However, when we have them we should implement them properly, of
course.

> This patch fixes the block comment parsing.

Thanks, I'll look into it.  On the first read, I don't like your use
of macros.  Do you think it is possible to rewrite your patch to use
inline functions instead?  Then, why did you do this change to
scm_getc:

    --- old/guile-1.3.4/libguile/ports.c	Mon Sep 20 16:34:57 1999
    +++ guile-1.3.4/libguile/ports.c	Sat Apr 29 19:43:25 2000
    @@ -703,14 +703,9 @@
       int c;
       scm_port *pt = SCM_PTAB_ENTRY (port);

    -  if (pt->rw_active == SCM_PORT_WRITE)
    -    {
    -      /* may be marginally faster than calling scm_flush.  */
    -      scm_ptobs[SCM_PTOBNUM (port)].flush (port);
    -    }
    +  if (pt->rw_active == SCM_PORT_WRITE) scm_flush(port);
   
That is, why did you replace the `marginally faster' thing with a call
to scm_flush?

Last point: I think it is sensible to restrict SCM_LINE_INCREMENTORS
to be a single character.  However, we should probably rename the
macro to SCM_LINE_INCREMENTER and then use it like so

    while ((bp = memchr(bp, SCM_LINE_INCREMENTER, be - bp)) == NULL)

Do you think you can update your patch based on these comments?

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