diff options
author | Andy Wingo <wingo@pobox.com> | 2018-08-19 17:38:11 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2018-08-19 17:38:11 +0200 |
commit | cf0270cb4c5b098773a98e2a688906944ab9661e (patch) | |
tree | 0fe4166a2175244f97593fa73b944292cede8422 /libguile/gsubr.c | |
parent | 3827769aff190a5e155b29d37fe157dd6115ad04 (diff) | |
download | guile-cf0270cb4c5b098773a98e2a688906944ab9661e.tar.gz |
Add internal function mapping subr index to function
* libguile/gsubr.h:
* libguile/gsubr.c (scm_subr_function_by_index): New internal function.
(scm_subr_function): Use new function.
Diffstat (limited to 'libguile/gsubr.c')
-rw-r--r-- | libguile/gsubr.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libguile/gsubr.c b/libguile/gsubr.c index 2384776e0..b99cc67ca 100644 --- a/libguile/gsubr.c +++ b/libguile/gsubr.c @@ -441,12 +441,18 @@ scm_i_primitive_name (const uint32_t *code) } scm_t_subr -scm_subr_function (SCM subr) +scm_subr_function_by_index (uint32_t idx) { - uint32_t idx = primitive_subr_idx (SCM_PROGRAM_CODE (subr)); if (idx == NOT_A_SUBR_CALL) abort (); return subrs[idx]; +} + +scm_t_subr +scm_subr_function (SCM subr) +{ + uint32_t idx = primitive_subr_idx (SCM_PROGRAM_CODE (subr)); + return scm_subr_function_by_index (idx); } SCM |