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: SCM_NUM2LONG_DEF fix?


Janis Dzerins <jonis@mt.lv> writes:

> Hello!
> 
> I'm posting to this list first time although I've been following it for
> some time already. I hope to join the developement team of guile
> sometimes but until then I have one question:
> 
> Should the following line in scm_validate.h:
> 
> #define SCM_NUM2LONG_DEF(pos,arg,def) (SCM_UNBNDP(arg)?SCM_MAKINUM(def):(scm_num2long(arg, (char *) pos, FUNC_NAME)))
>                                                        ^^^^^^^^^^^^^^^^
> be like this:
> 
> #define SCM_NUM2LONG_DEF(pos,arg,def) (SCM_UNBNDP(arg)?(def):(scm_num2long(arg, (char *) pos, FUNC_NAME)))
>                                                        ^^^^^

Well, there's only one place where it is currently used (filesys.c):

  imode = SCM_NUM2LONG_DEF(3,mode,0666);

so it's right relative to that use.  The question is whether the use
should be:

  imode = SCM_NUM2LONG_DEF(3,mode,SCM_MAKINUM(0666));
 
and I prefer the former, and I've done things that way with, e.g.,
SCM_VALIDATE_INUM_DEF_COPY, too, as well as with analagous macros in
Scwm.  It handles the common case better.

And please hop on board with development of Guile... a great way to
start is by contributing documentation strings for the various
SCM_DEFINE procedures that still need them!

Thanks,
Greg

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