summaryrefslogtreecommitdiff
path: root/libguile/srcprop.c
diff options
context:
space:
mode:
Diffstat (limited to 'libguile/srcprop.c')
-rw-r--r--libguile/srcprop.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libguile/srcprop.c b/libguile/srcprop.c
index 77430bd82..b2e4ff322 100644
--- a/libguile/srcprop.c
+++ b/libguile/srcprop.c
@@ -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 ()
{