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]

scm_map and rest arguments


Hello!

Inspired by a hint from Jost Boekemeier I figured out that the test
SCM_VALIDATE_REST_ARGUMENT in scm_map and also in scm_for_each (both in
eval.c) is redundant, since the rest argument is passed on to scm_vector,
which will for itself perform testing of the rest argument (note that
these tests are only performed if SCM_DEBUG_REST_ARGUMENT==1).

The question is, whether the test should be eliminated at that point?  
With the current solution it does not cause a performance problem, since
rest argument checking is disabled by default (Jost questions this
decision by me, btw.), and with a guile compiled for debugging a
non-optimal performance is OK, I think.

If the default is to be left that way, then I'm in favor of leaving things
as they are, since it seems cleaner to me to check parameters ASAP and
report problems where they occur.  If the maintainers decide to change
that default, however, then it might make sense to rely on the checking
being performed in scm_vector, because otherwise we get a performance
penalty due to double checks.

So, what about these tests?

Best regards
Dirk


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