#undef FUNC_NAME
-SCM_DEFINE (scm_srfi1_eighth, "eighth", 1, 0, 0,
- (SCM lst),
- "Return the eighth element of @var{lst}.")
-#define FUNC_NAME s_scm_srfi1_eighth
+SCM
+scm_srfi1_eighth (SCM lst)
{
- return scm_list_ref (lst, SCM_I_MAKINUM (7));
+ CACHE_VAR (eighth, "eighth");
+ return scm_call_1 (eighth, lst);
}
-#undef FUNC_NAME
-
-SCM_DEFINE (scm_srfi1_fifth, "fifth", 1, 0, 0,
- (SCM lst),
- "Return the fifth element of @var{lst}.")
-#define FUNC_NAME s_scm_srfi1_fifth
+SCM
+scm_srfi1_fifth (SCM lst)
{
- return scm_list_ref (lst, SCM_I_MAKINUM (4));
+ CACHE_VAR (fifth, "fifth");
+ return scm_call_1 (fifth, lst);
}
-#undef FUNC_NAME
SCM_DEFINE (scm_srfi1_filter_map, "filter-map", 2, 0, 1,
#undef FUNC_NAME
-SCM_DEFINE (scm_srfi1_ninth, "ninth", 1, 0, 0,
- (SCM lst),
- "Return the ninth element of @var{lst}.")
-#define FUNC_NAME s_scm_srfi1_ninth
+SCM
+scm_srfi1_ninth (SCM lst)
{
- return scm_list_ref (lst, scm_from_int (8));
+ CACHE_VAR (ninth, "ninth");
+ return scm_call_1 (ninth, lst);
}
-#undef FUNC_NAME
SCM
scm_srfi1_not_pair_p (SCM obj)
#undef FUNC_NAME
-SCM_DEFINE (scm_srfi1_seventh, "seventh", 1, 0, 0,
- (SCM lst),
- "Return the seventh element of @var{lst}.")
-#define FUNC_NAME s_scm_srfi1_seventh
+SCM
+scm_srfi1_seventh (SCM lst)
{
- return scm_list_ref (lst, scm_from_int (6));
+ CACHE_VAR (seventh, "seventh");
+ return scm_call_1 (seventh, lst);
}
-#undef FUNC_NAME
-
-SCM_DEFINE (scm_srfi1_sixth, "sixth", 1, 0, 0,
- (SCM lst),
- "Return the sixth element of @var{lst}.")
-#define FUNC_NAME s_scm_srfi1_sixth
+SCM
+scm_srfi1_sixth (SCM lst)
{
- return scm_list_ref (lst, scm_from_int (5));
+ CACHE_VAR (sixth, "sixth");
+ return scm_call_1 (sixth, lst);
}
-#undef FUNC_NAME
SCM_DEFINE (scm_srfi1_span, "span", 2, 0, 0,
}
#undef FUNC_NAME
-
-SCM_DEFINE (scm_srfi1_tenth, "tenth", 1, 0, 0,
- (SCM lst),
- "Return the tenth element of @var{lst}.")
-#define FUNC_NAME s_scm_srfi1_tenth
+SCM
+scm_srfi1_tenth (SCM lst)
{
- return scm_list_ref (lst, scm_from_int (9));
+ CACHE_VAR (tenth, "tenth");
+ return scm_call_1 (tenth, lst);
}
-#undef FUNC_NAME
-
SCM
scm_srfi1_xcons (SCM d, SCM a)
;;
(with-test-prefix "eighth"
- (pass-if-exception "() -1" exception:out-of-range
+ (pass-if-exception "() -1" exception:wrong-type-arg
(eighth '(a b c d e f g)))
(pass-if (eq? 'h (eighth '(a b c d e f g h))))
(pass-if (eq? 'h (eighth '(a b c d e f g h i)))))
;;
(with-test-prefix "fifth"
- (pass-if-exception "() -1" exception:out-of-range
+ (pass-if-exception "() -1" exception:wrong-type-arg
(fifth '(a b c d)))
(pass-if (eq? 'e (fifth '(a b c d e))))
(pass-if (eq? 'e (fifth '(a b c d e f)))))
;;
(with-test-prefix "ninth"
- (pass-if-exception "() -1" exception:out-of-range
+ (pass-if-exception "() -1" exception:wrong-type-arg
(ninth '(a b c d e f g h)))
(pass-if (eq? 'i (ninth '(a b c d e f g h i))))
(pass-if (eq? 'i (ninth '(a b c d e f g h i j)))))
;;
(with-test-prefix "seventh"
- (pass-if-exception "() -1" exception:out-of-range
+ (pass-if-exception "() -1" exception:wrong-type-arg
(seventh '(a b c d e f)))
(pass-if (eq? 'g (seventh '(a b c d e f g))))
(pass-if (eq? 'g (seventh '(a b c d e f g h)))))
;;
(with-test-prefix "sixth"
- (pass-if-exception "() -1" exception:out-of-range
+ (pass-if-exception "() -1" exception:wrong-type-arg
(sixth '(a b c d e)))
(pass-if (eq? 'f (sixth '(a b c d e f))))
(pass-if (eq? 'f (sixth '(a b c d e f g)))))
;;
(with-test-prefix "tenth"
- (pass-if-exception "() -1" exception:out-of-range
+ (pass-if-exception "() -1" exception:wrong-type-arg
(tenth '(a b c d e f g h i)))
(pass-if (eq? 'j (tenth '(a b c d e f g h i j))))
(pass-if (eq? 'j (tenth '(a b c d e f g h i j k)))))