guile-devel
[Top][All Lists]
Advanced

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

Re: Guile C preprocessor


From: Dirk Herrmann
Subject: Re: Guile C preprocessor
Date: Tue, 12 Dec 2000 11:29:09 +0100 (MET)

On 10 Dec 2000, Neil Jerram wrote:

> >>>>> "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.

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

The current system may not be optimal, but we already have a design for an
improved set of snarfing macros.  The only remaining problem that I see is
the need to always have to add #define FUNC_NAME, but with the new C
standard, this can be dropped in favor of __func__.

Best regards,
Dirk Herrmann




reply via email to

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