summaryrefslogtreecommitdiff
path: root/libguile/pairs.c
diff options
context:
space:
mode:
Diffstat (limited to 'libguile/pairs.c')
-rw-r--r--libguile/pairs.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/libguile/pairs.c b/libguile/pairs.c
index 812c39235..48db366b3 100644
--- a/libguile/pairs.c
+++ b/libguile/pairs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,2000,2001 Free Software Foundation, Inc.
*
* 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
@@ -54,6 +54,20 @@
/* {Pairs}
*/
+#if (SCM_DEBUG_PAIR_ACCESSES == 1)
+
+#include "libguile/ports.h"
+#include "libguile/strings.h"
+
+void scm_error_pair_access (SCM non_pair)
+{
+ SCM message = scm_makfrom0str ("Non-pair accessed with SCM_C[AD]R: `~Sī\n");
+ scm_simple_format (scm_current_error_port (), message, SCM_LIST1 (non_pair));
+ abort ();
+}
+
+#endif
+
SCM_DEFINE (scm_cons, "cons", 2, 0, 0,
(SCM x, SCM y),
"Return a newly allocated pair whose car is @var{x} and whose\n"