summaryrefslogtreecommitdiff
path: root/libguile/pairs.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2012-05-17 11:21:15 +0200
committerAndy Wingo <wingo@pobox.com>2012-05-17 11:25:58 +0200
commit730af462c387ce9cca30e84b8963edba10399d2e (patch)
treeb6bcf1f6801269dcb1163b77b24a7959128e9dbb /libguile/pairs.c
parent688291fe19a620cb46f8286ff088891da1ed8169 (diff)
downloadguile-730af462c387ce9cca30e84b8963edba10399d2e.tar.gz
inline scm_cons, scm_car, scm_cdr
* libguile/pairs.h (scm_cons, scm_car, scm_cdr): Define these as inline functions. (scm_is_pair): Move here from inline.h. * libguile/pairs.c: Remove definitions here, and define gsubrs. * libguile/inline.h: Remove scm_is_pair implementation. * libguile/inline.c: Include pairs.h to residualize inlines from pairs.h.
Diffstat (limited to 'libguile/pairs.c')
-rw-r--r--libguile/pairs.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/libguile/pairs.c b/libguile/pairs.c
index 5dbbab566..1a3c5a18c 100644
--- a/libguile/pairs.c
+++ b/libguile/pairs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,2000,2001, 2004, 2005, 2006, 2008, 2009, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,2000,2001, 2004, 2005, 2006, 2008, 2009, 2011, 2012 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -67,18 +67,6 @@ void scm_error_pair_access (SCM non_pair)
#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"
- "cdr is @var{y}. The pair is guaranteed to be different (in the\n"
- "sense of @code{eq?}) from every previously existing object.")
-#define FUNC_NAME s_scm_cons
-{
- return scm_cell (SCM_UNPACK (x), SCM_UNPACK (y));
-}
-#undef FUNC_NAME
-
-
SCM
scm_cons2 (SCM w, SCM x, SCM y)
{
@@ -143,14 +131,6 @@ SCM_DEFINE (scm_set_cdr_x, "set-cdr!", 2, 0, 0,
return tree
-SCM_DEFINE (scm_cdr, "cdr", 1, 0, 0, (SCM x), "")
-{
- CHASE_PAIRS (x, "cdr", 0x02); /* 00000010 */
-}
-SCM_DEFINE (scm_car, "car", 1, 0, 0, (SCM x), "")
-{
- CHASE_PAIRS (x, "car", 0x03); /* 00000011 */
-}
SCM_DEFINE (scm_cddr, "cddr", 1, 0, 0, (SCM x), "")
{
CHASE_PAIRS (x, "cddr", 0x0a); /* 00001010 */
@@ -270,6 +250,9 @@ void
scm_init_pairs ()
{
#include "libguile/pairs.x"
+ scm_c_define_gsubr ("cons", 2, 0, 0, scm_cons);
+ scm_c_define_gsubr ("car", 1, 0, 0, scm_car);
+ scm_c_define_gsubr ("cdr", 1, 0, 0, scm_cdr);
}