[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SCM_EVALIM2
From: |
Dirk Herrmann |
Subject: |
Re: SCM_EVALIM2 |
Date: |
Fri, 1 Jun 2001 12:14:11 +0200 (MEST) |
On 1 Jun 2001, Marius Vollmer wrote:
> Dirk Herrmann <address@hidden> writes:
>
> > Ooops. What I actually meant was: Replace the two calls to SCM_EVALIM2
> > in eval.c by the error checks that they actually represent. Keep
> > SCM_EVALIM2 as an internal macro in eval.h.
>
> Hmm, this would also spread the locus for the "empty combination"
> error message to three places in the code. Just casting the call to
> SCM_EVALIM2 to (void) in the two places in eval.c and putting a
> comment there that we are only interested in the error message sounds
> better to me.
>
> Or have a new macro SCM_VALIDATE_NON_EMPTY_COMBINATION and use that in
> the three places.
Yes, that would be best. I think it is confusing to have
(void)SCM_EVALIM2, since it indicates a sideeffect. You could argue that
error checking _is_ some kind of side effect, but it is not the kind of
_typical_ sideeffect for which the (void)foo pattern is normally used.
I would suggest, however, to have SCM_VALIDATE_NON_EMPTY_COMBINATION
defined within eval.c. As I said in a previous mail with regards to the
various SCM_VALIDATE_FOO_OR_BAR_OR_NOTHING_OR_WHATEVER_COPY_DEF macros,
these don't belong into the interface.
If inline functions are available, I'd probably prefer to have macros as
SCM_VALIDATE_FOO_COPY (1, foo, cfoo);
replaced by
cfoo = scm_validate_arg_foo (1, foo);
and
SCM_VALIDATE_FOO_DEF_COPY (1, foo, foo_default, cfoo);
replaced by
cfoo = scm_validate_optarg_foo (1, foo, foo_default);
or something similar. However, it is a challenge to find a common style
to define such functions, since there a far more cases to be considered...
Best regards,
Dirk Herrmann
- Re: SCM_EVALIM2,
Dirk Herrmann <=