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: new snarf macro: SCM_VAR


On 4 May 2000, Keisuke Nishida wrote:

> Defining SCM_VAR is pretty easy and generally useful, I think.
> So, how about defining the following macros in Guile's snarf.h?
> 
>   #define SCM_VAR(NAME, CODE) \
>   SCM_HERE (static SCM NAME) \
>   SCM_INIT (NAME = CODE)
> 
>   #define SCM_GLOBAL_VAR(NAME, CODE) \
>   SCM_HERE (SCM NAME) \
>   SCM_INIT (NAME = CODE)

I think adding such a macro would be a good idea.  You would have to
protect the variable contents from gc, though.

However, I do have some problems with the current naming of all these
snarfing macros:  
* I'd prefer a common prefix like SCM_DECLARE_, for example
  SCM_DECLARE_FUNCTION or something.
* To me it is strange that a declaration SCM_SYMBOL will generate a static
  definition, while SCM_GLOBAL_SYMBOL will provide a non-static one.  I'd
  prefer SCM_DECLARE_STATIC_... for static definitions, because that's the
  way a C programmer thinks.

Do others feel the same way?

Best regards
Dirk Herrmann


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