This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: SCM_NUM2LONG_DEF fix?
- To: Janis Dzerins <jonis at mt dot lv>
- Subject: Re: SCM_NUM2LONG_DEF fix?
- From: "Greg J. Badros" <gjb at cs dot washington dot edu>
- Date: 13 Jan 2000 10:19:36 -0800
- Cc: guile at sourceware dot cygnus dot com
- References: <Pine.LNX.4.10.10001131607080.741-100000@goo.dev.mt.lv>
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