mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +02:00
factor copy-tree and cons-source out of eval.[ch]
* libguile.h: * libguile/Makefile.am * libguile/init.c (scm_i_init_guile): Add trees.[ch] to the build. * libguile/eval.c: * libguile/eval.h: Remove scm_copy_tree and scm_cons_source... * libguile/trees.h: * libguile/trees.c: * libguile/srcprop.h: * libguile/srcprop.c: ... factoring them out here and here, respectively. * test-suite/tests/eval.test ("memoization"): Change expected exception for circular data structures, given new copy-tree location.
This commit is contained in:
parent
504864b79f
commit
0f458a3725
11 changed files with 286 additions and 184 deletions
|
@ -383,6 +383,24 @@ SCM_DEFINE (scm_set_source_property_x, "set-source-property!", 3, 0, 0,
|
|||
#undef FUNC_NAME
|
||||
|
||||
|
||||
SCM_DEFINE (scm_cons_source, "cons-source", 3, 0, 0,
|
||||
(SCM xorig, SCM x, SCM y),
|
||||
"Create and return a new pair whose car and cdr are @var{x} and @var{y}.\n"
|
||||
"Any source properties associated with @var{xorig} are also associated\n"
|
||||
"with the new pair.")
|
||||
#define FUNC_NAME s_scm_cons_source
|
||||
{
|
||||
SCM p, z;
|
||||
z = scm_cons (x, y);
|
||||
/* Copy source properties possibly associated with xorig. */
|
||||
p = scm_whash_lookup (scm_source_whash, xorig);
|
||||
if (scm_is_true (p))
|
||||
scm_whash_insert (scm_source_whash, z, p);
|
||||
return z;
|
||||
}
|
||||
#undef FUNC_NAME
|
||||
|
||||
|
||||
void
|
||||
scm_init_srcprop ()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue