summaryrefslogtreecommitdiff
path: root/libguile/srfi-1.c
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2010-09-20 00:00:44 +0200
committerLudovic Courtès <ludo@gnu.org>2010-09-20 00:01:23 +0200
commit194865d2f7df43aec742c7cdd658050bb4caeb94 (patch)
tree8ac2441807c29d698fd050dc234fb7c342bd0e1f /libguile/srfi-1.c
parentcd99e21cd469bb3abaa09055d30f0d5e98ab6f1c (diff)
downloadguile-194865d2f7df43aec742c7cdd658050bb4caeb94.tar.gz
SRFI-1: Rewrite `alist-copy' in Scheme.
This partially reverts commit b1fff4e793619b20342cba0015b9367680d3a0bd (Sat Apr 2 2005). * libguile/srfi-1.c (scm_srfi1_alist_copy): Remove. * libguile/srfi-1.h (scm_srfi1_alist_copy): Remove declaration. * module/srfi/srfi-1.scm (alist-copy): New procedure.
Diffstat (limited to 'libguile/srfi-1.c')
-rw-r--r--libguile/srfi-1.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/libguile/srfi-1.c b/libguile/srfi-1.c
index 6eace5f31..2fb677a7a 100644
--- a/libguile/srfi-1.c
+++ b/libguile/srfi-1.c
@@ -104,41 +104,6 @@ list_copy_part (SCM lst, int count, SCM *dst)
#undef FUNC_NAME
-SCM_DEFINE (scm_srfi1_alist_copy, "alist-copy", 1, 0, 0,
- (SCM alist),
- "Return a copy of @var{alist}, copying both the pairs comprising\n"
- "the list and those making the associations.")
-#define FUNC_NAME s_scm_srfi1_alist_copy
-{
- SCM ret, *p, elem, c;
-
- /* ret is the list to return. p is where to append to it, initially &ret
- then SCM_CDRLOC of the last pair. */
- ret = SCM_EOL;
- p = &ret;
-
- for ( ; scm_is_pair (alist); alist = SCM_CDR (alist))
- {
- elem = SCM_CAR (alist);
-
- /* each element of alist must be a pair */
- SCM_ASSERT_TYPE (scm_is_pair (elem), alist, SCM_ARG1, FUNC_NAME,
- "association list");
-
- c = scm_cons (scm_cons (SCM_CAR (elem), SCM_CDR (elem)), SCM_EOL);
- *p = c;
- p = SCM_CDRLOC (c);
- }
-
- /* alist must be a proper list */
- SCM_ASSERT_TYPE (SCM_NULL_OR_NIL_P (alist), alist, SCM_ARG1, FUNC_NAME,
- "association list");
- return ret;
-}
-#undef FUNC_NAME
-
-
-
SCM_DEFINE (scm_srfi1_append_reverse, "append-reverse", 2, 0, 0,
(SCM revhead, SCM tail),
"Reverse @var{rev-head}, append @var{tail} to it, and return the\n"