mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-29 19:30:36 +02:00
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.
This commit is contained in:
parent
3827769aff
commit
cf0270cb4c
2 changed files with 9 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -57,6 +57,7 @@ SCM_INTERNAL uintptr_t scm_i_primitive_call_ip (SCM subr);
|
|||
SCM_INTERNAL SCM scm_i_primitive_name (const uint32_t *code);
|
||||
|
||||
SCM_API scm_t_subr scm_subr_function (SCM subr);
|
||||
SCM_INTERNAL scm_t_subr scm_subr_function_by_index (uint32_t subr_idx);
|
||||
SCM_API SCM scm_subr_name (SCM subr);
|
||||
|
||||
SCM_INTERNAL SCM scm_apply_subr (union scm_vm_stack_element *sp,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue