summaryrefslogtreecommitdiff
path: root/libguile/pairs.c
diff options
context:
space:
mode:
authorDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2001-06-07 21:12:19 +0000
committerDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2001-06-07 21:12:19 +0000
commite81d98ec2d12d9101dc79928833b2c064d148afc (patch)
treed5966566fc4c86bca904ea941bfc6a19cc464918 /libguile/pairs.c
parent563058efbe03208cacb43f664c702e3979922cb6 (diff)
downloadguile-e81d98ec2d12d9101dc79928833b2c064d148afc.tar.gz
* Introduce SCM_UNUSED and mark unused function parameters.
* Introduce SCM_DEBUG_PAIR_ACCESSES. * Extend the possibilities of SCM_DEBUG_CELL_ACCESSES.
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"