mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-24 12:20:20 +02:00
Wire up ability to print RTL program arities
* libguile/procprop.c (scm_i_procedure_arity): Allow RTL programs to dispatch to scm_i_program_arity. * libguile/programs.c (scm_i_program_print): Refactor reference to write-program. (scm_i_rtl_program_minimum_arity): New procedure, dispatches to Scheme. (scm_i_program_arity): Dispatch to scm_i_rtl_program_minimum_arity if appropriate. * module/system/vm/debug.scm (program-minimum-arity): New export. * module/system/vm/program.scm (rtl-program-minimum-arity): New internal function. (program-arguments-alists): New helper, implemented also for RTL procedures. (write-program): Refactor a bit, and call program-arguments-alists. * test-suite/tests/rtl.test ("simply procedure arity"): Add tests that arities make it all the way to cold ELF and back to warm Guile.
This commit is contained in:
parent
f88e574d58
commit
eb2bc00fb3
5 changed files with 100 additions and 34 deletions
|
@ -60,7 +60,7 @@ scm_i_procedure_arity (SCM proc, int *req, int *opt, int *rest)
|
|||
return 1;
|
||||
}
|
||||
|
||||
while (!SCM_PROGRAM_P (proc))
|
||||
while (!SCM_PROGRAM_P (proc) && !SCM_RTL_PROGRAM_P (proc))
|
||||
{
|
||||
if (SCM_STRUCTP (proc))
|
||||
{
|
||||
|
@ -80,14 +80,6 @@ scm_i_procedure_arity (SCM proc, int *req, int *opt, int *rest)
|
|||
see. */
|
||||
*req -= 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
else if (SCM_RTL_PROGRAM_P (proc))
|
||||
{
|
||||
*req = 0;
|
||||
*opt = 0;
|
||||
*rest = 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue