1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00

* debug.c (scm_procedure_source): Handle all objects for which

procedure? is #t.  (Thanks to Bill Schottstaedt.)
This commit is contained in:
Mikael Djurfeldt 2003-02-05 19:05:42 +00:00
parent a5a203db18
commit 5abeba6894
2 changed files with 29 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2003-02-05 Mikael Djurfeldt <djurfeldt@nada.kth.se>
* debug.c (scm_procedure_source): Handle all objects for which
procedure? is #t. (Thanks to Bill Schottstaedt.)
2003-02-01 Rob Browning <rlb@defaultvalue.org> 2003-02-01 Rob Browning <rlb@defaultvalue.org>
* Makefile.am: move built files to nodist_ targets so they don't * Makefile.am: move built files to nodist_ targets so they don't

View file

@ -1,5 +1,5 @@
/* Debugging extensions for Guile /* Debugging extensions for Guile
* Copyright (C) 1995,1996,1997,1998,1999,2000,2001 Free Software Foundation * Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2003 Free Software Foundation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -63,6 +63,7 @@
#include "libguile/ports.h" #include "libguile/ports.h"
#include "libguile/root.h" #include "libguile/root.h"
#include "libguile/fluids.h" #include "libguile/fluids.h"
#include "libguile/objects.h"
#include "libguile/validate.h" #include "libguile/validate.h"
#include "libguile/debug.h" #include "libguile/debug.h"
@ -411,12 +412,15 @@ SCM_DEFINE (scm_procedure_name, "procedure-name", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
#define scm_tcs_struct scm_tcs_cons_gloc
SCM_DEFINE (scm_procedure_source, "procedure-source", 1, 0, 0, SCM_DEFINE (scm_procedure_source, "procedure-source", 1, 0, 0,
(SCM proc), (SCM proc),
"Return the source of the procedure @var{proc}.") "Return the source of the procedure @var{proc}.")
#define FUNC_NAME s_scm_procedure_source #define FUNC_NAME s_scm_procedure_source
{ {
SCM_VALIDATE_NIM (1,proc); SCM_VALIDATE_NIM (1,proc);
again:
switch (SCM_TYP7 (proc)) { switch (SCM_TYP7 (proc)) {
case scm_tcs_closures: case scm_tcs_closures:
{ {
@ -430,17 +434,34 @@ SCM_DEFINE (scm_procedure_source, "procedure-source", 1, 0, 0,
SCM_EOL, SCM_EOL,
SCM_ENV (proc)))); SCM_ENV (proc))));
} }
case scm_tcs_struct:
if (!SCM_I_OPERATORP (proc))
break;
goto procprop;
case scm_tc7_smob:
if (!SCM_SMOB_DESCRIPTOR (proc).apply)
break;
case scm_tcs_subrs: case scm_tcs_subrs:
#ifdef CCLO #ifdef CCLO
case scm_tc7_cclo: case scm_tc7_cclo:
#endif #endif
procprop:
/* It would indeed be a nice thing if we supplied source even for /* It would indeed be a nice thing if we supplied source even for
built in procedures! */ built in procedures! */
return scm_procedure_property (proc, scm_sym_source); return scm_procedure_property (proc, scm_sym_source);
default: case scm_tc7_pws:
SCM_WRONG_TYPE_ARG (1, proc); {
/* not reached */ SCM src = scm_procedure_property (proc, scm_sym_source);
if (!SCM_FALSEP (src))
return src;
proc = SCM_PROCEDURE (proc);
goto again;
} }
default:
;
}
SCM_WRONG_TYPE_ARG (1, proc);
return SCM_BOOL_F; /* not reached */
} }
#undef FUNC_NAME #undef FUNC_NAME