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: interface reductions


Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:

> I figured out that the macros and declarations below can be removed from
> the header files, since they are not use at all or only within the
> corresponding C file.  Thus, if nobody objects I will move those
> declarations into #if (SCM_DEBUG_DEPRECATED == 0) ... #endif regions, thus
> deprecating their external use.

OK, here comes the objection:

All scm_tc16_* codes should be declared in *.h files.  A lot of the
scm_tc16_ codes need to be accessible across compilation units.  It is
better to be consistent than to have to make things public when
needed.

Similarly, as many Guile data types as possible should have type
predicates declared in header files so that applications and Guile C
modules can use them.

Therefore, the following declarations should be kept:

> filesys.h: 
>   scm_tc16_dir
>   SCM_DIRP
> 
> fluids.h:
>   scm_tc16_fluid
>   SCM_FLUIDP
> 
> hooks.h:
>   scm_tc16_hook
>   SCM_HOOKP
> 
> keywords.h:
>   scm_tc16_keyword
>   SCM_KEYWORDP

Furthermore, we need to keep in mind that the scm_ interface has two
roles: 1. implementing Guile, 2. being an interface for applications
and Guile C modules.  On these grounds, the following macros should be
kept:

> fluids.h:
>   SCM_FLUID_NUM
>   SCM_FAST_FLUID_REF
>   SCM_FAST_FLUID_SET_X
> 
> hooks.h:
>   SCM_HOOK_ARITY
>   SCM_HOOK_NAME
>   SCM_HOOK_PROCEDURES
>   SCM_SET_HOOK_PROCEDURES
> 
> validate.h:
>   SCM_VALIDATE_NUMBER_COPY
>   SCM_VALIDATE_BIGINT

SCM_VALIDATE_NUMBER_COPY was added April 17...  It was added because
it was needed in an application.  It seems reasonable to support
validating a numeric argument, don't you think?

Also, the following macros should probably be kept, but maybe under
better names:

> filesys.h: 
>   SCM_OPDIRP
> 
> fports.h:
>   SCM_OPINFPORTP
>   SCM_OPOUTFPORTP
> 
> keywords.h:
>   SCM_KEYWORDSYM
> 
> numbers.h:
>   SCM_MAXEXP
>   SCM_DIGSTOOBIG
>   SCM_DIGSPERLONG
>   SCM_BIGUP
>   SCM_LONGLONGBIGUP
>   SCM_BIGDN
>   SCM_BIGLO
>   SCM_BIGSIGNFLAG
>   SCM_BIGSIGN
>   SCM_SETNUMDIGS

(I didn't look at the details of the BIGNUM macros.  Since we're going
 to replace the bignums with libgmp, most of these will be irrelevant,
 but there's no reason why we should remove them now.)


To summarize: It is OK to remove SCM_UNPACK_CAR, and we should
probably find better names for some macros.

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