\f
#include <stdio.h>
-#include "_scm.h"
-#include "eq.h"
+#include "libguile/_scm.h"
+#include "libguile/eq.h"
-#include "scm_validate.h"
-#include "list.h"
+#include "libguile/validate.h"
+#include "libguile/list.h"
#ifdef __STDC__
#include <stdarg.h>
SCM *pos = &answer;
var_start (foo, elt);
- while (elt != SCM_UNDEFINED)
+ while (! SCM_UNBNDP (elt))
{
*pos = scm_cons (elt, SCM_EOL);
pos = SCM_CDRLOC (*pos);
/* For every two steps the hare takes, the tortoise takes one. */
tortoise = SCM_CDR(tortoise);
}
- while (hare != tortoise);
+ while (! SCM_EQ_P (hare, tortoise));
/* If the tortoise ever catches the hare, then the list must contain
a cycle. */
hare = ahead;
tortoise = SCM_CDR(tortoise);
}
- while (hare != tortoise);
+ while (! SCM_EQ_P (hare, tortoise));
SCM_MISC_ERROR ("Circular structure in position 1: ~S", SCM_LIST1 (lst));
}
#undef FUNC_NAME
hare = SCM_CDR (hare);
tortoise = SCM_CDR (tortoise);
}
- while (hare != tortoise);
+ while (! SCM_EQ_P (hare, tortoise));
SCM_MISC_ERROR ("Circular structure in position 1: ~S", SCM_LIST1 (lst));
}
#undef FUNC_NAME
{
for(; SCM_CONSP (lst); lst = SCM_CDR(lst))
{
- if (SCM_CAR(lst)==x)
+ if (SCM_EQ_P (SCM_CAR (lst), x))
return lst;
}
return lst;
{
for(; SCM_CONSP (lst); lst = SCM_CDR(lst))
{
- if (SCM_BOOL_F != scm_eqv_p (SCM_CAR(lst), x))
+ if (! SCM_FALSEP (scm_eqv_p (SCM_CAR (lst), x)))
return lst;
}
return lst;
{
for(; SCM_CONSP (lst); lst = SCM_CDR(lst))
{
- if (SCM_BOOL_F != scm_equal_p (SCM_CAR(lst), x))
+ if (! SCM_FALSEP (scm_equal_p (SCM_CAR (lst), x)))
return lst;
}
return lst;
SCM answer;
SCM_VALIDATE_LIST (2,lst);
answer = scm_sloppy_memq (x, lst);
- return (answer == SCM_EOL) ? SCM_BOOL_F : answer;
+ return (SCM_NULLP (answer)) ? SCM_BOOL_F : answer;
}
#undef FUNC_NAME
SCM answer;
SCM_VALIDATE_LIST (2,lst);
answer = scm_sloppy_memv (x, lst);
- return (answer == SCM_EOL) ? SCM_BOOL_F : answer;
+ return (SCM_NULLP (answer)) ? SCM_BOOL_F : answer;
}
#undef FUNC_NAME
SCM answer;
SCM_VALIDATE_LIST (2,lst);
answer = scm_sloppy_member (x, lst);
- return (answer == SCM_EOL) ? SCM_BOOL_F : answer;
+ return (SCM_NULLP (answer)) ? SCM_BOOL_F : answer;
}
#undef FUNC_NAME
SCM_CONSP (walk);
walk = SCM_CDR (walk))
{
- if (SCM_CAR (walk) == item)
+ if (SCM_EQ_P (SCM_CAR (walk), item))
*prev = SCM_CDR (walk);
else
prev = SCM_CDRLOC (walk);
SCM_CONSP (walk);
walk = SCM_CDR (walk))
{
- if (SCM_BOOL_F != scm_eqv_p (SCM_CAR (walk), item))
+ if (! SCM_FALSEP (scm_eqv_p (SCM_CAR (walk), item)))
*prev = SCM_CDR (walk);
else
prev = SCM_CDRLOC (walk);
SCM_CONSP (walk);
walk = SCM_CDR (walk))
{
- if (SCM_BOOL_F != scm_equal_p (SCM_CAR (walk), item))
+ if (! SCM_FALSEP (scm_equal_p (SCM_CAR (walk), item)))
*prev = SCM_CDR (walk);
else
prev = SCM_CDRLOC (walk);
SCM_DEFINE (scm_delq1_x, "delq1!", 2, 0, 0,
(SCM item, SCM lst),
- "")
+ "Like `delq!', but only deletes the first occurrence of ITEM from LST.\n"
+ "Tests for equality using `eq?'. See also `delv1!' and `delete1!'.")
#define FUNC_NAME s_scm_delq1_x
{
SCM walk;
SCM_CONSP (walk);
walk = SCM_CDR (walk))
{
- if (SCM_CAR (walk) == item)
+ if (SCM_EQ_P (SCM_CAR (walk), item))
{
*prev = SCM_CDR (walk);
break;
SCM_DEFINE (scm_delv1_x, "delv1!", 2, 0, 0,
- (SCM item, SCM lst),
- "")
+ (SCM item, SCM lst),
+ "Like `delv!', but only deletes the first occurrence of ITEM from LST.\n"
+ "Tests for equality using `eqv?'. See also `delq1!' and `delete1!'.")
#define FUNC_NAME s_scm_delv1_x
{
SCM walk;
SCM_CONSP (walk);
walk = SCM_CDR (walk))
{
- if (SCM_BOOL_F != scm_eqv_p (SCM_CAR (walk), item))
+ if (! SCM_FALSEP (scm_eqv_p (SCM_CAR (walk), item)))
{
*prev = SCM_CDR (walk);
break;
SCM_DEFINE (scm_delete1_x, "delete1!", 2, 0, 0,
- (SCM item, SCM lst),
- "")
+ (SCM item, SCM lst),
+ "Like `delete!', but only deletes the first occurrence of ITEM from LST.\n"
+ "Tests for equality using `equal?'. See also `delq1!' and `delv1!'.")
#define FUNC_NAME s_scm_delete1_x
{
SCM walk;
SCM_CONSP (walk);
walk = SCM_CDR (walk))
{
- if (SCM_BOOL_F != scm_equal_p (SCM_CAR (walk), item))
+ if (! SCM_FALSEP (scm_equal_p (SCM_CAR (walk), item)))
{
*prev = SCM_CDR (walk);
break;
void
scm_init_list ()
{
-#include "list.x"
+#include "libguile/list.x"
}
+
+/*
+ Local Variables:
+ c-file-style: "gnu"
+ End:
+*/