guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guile C preprocessor


From: Neil Jerram
Subject: Re: Guile C preprocessor
Date: 13 Dec 2000 21:21:57 +0000

    >> >>>>> "Keisuke" == Keisuke Nishida <address@hidden> writes:
    >> 
    Keisuke> Hello, Is it a good idea to write a C preprocessor for
    Keisuke> Guile that can be used in place of guile-snarf like this?
    >>  Hmmm...  It looks interesting.  The main advantages seem to be
    >> (i) automatic generation of argument validation code (ii)
    >> possible future argument type reflection (iii) possible future
    >> replacement of argument validation by something like Mikael's
    >> Ior.

>>>>> "Dirk" == Dirk Herrmann <address@hidden> writes:

    Dirk> I don't think that we should use such a coding style.
    Dirk> Although it seems nice to be able to specify argument types,
    Dirk> in the general case it does not work this way, for example
    Dirk> if it is allowed to pass #f _or_ a number as an argument, or
    Dirk> if the conditions for arguments are even more complex.
    Dirk> Further, certain type checks (like checking for a list of
    Dirk> boolean values) are for performance reasons typically mixed
    Dirk> with the actual code of a function.

Good point.  But perhaps these conditions apply to a minority of
cases, and we could still use something like Keisuke's idea to
autogenerate code for arguments that _do_ always have to be of a
specific type.  For arguments where your considerations apply, a type
name like `mixed' or `nonautogen' could be used to indicate that the
body of the function will take care of the type checking for that
argument.

    Dirk> The current system may not be optimal, but we already have a
    Dirk> design for an improved set of snarfing macros.

Maybe it would be better to consider adding type declaration and
autogeneration of argument validation code as an incremental evolution
of the existing snarfing macros, or of the improved set?

What is the status of the new set of snarfing macros, BTW?  Last I
remember we decided that they should wait until post 1.4 - or was that
post 1.5?

Regards,
        Neil



reply via email to

[Prev in Thread] Current Thread [Next in Thread]