From a2230b653b86cece1daab09315873b5a4c592d6b Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Thu, 5 May 2011 23:07:23 +0200 Subject: map and for-each in scheme * module/ice-9/boot-9.scm (map, for-each): Implement in Scheme instead of C. There are boot versions before `cond' is defined. (map-in-order): Define this alias here instead of in evalext.h. * libguile/eval.c: Stub out the map and for-each definitions to just call into Scheme. * libguile/evalext.c: Remove map-in-order definition. * module/srfi/srfi-1.scm: Replace all calls to map1 with calls to map. (map, for-each): Define implementations here, in Scheme, instead of in C. * test-suite/tests/eval.test (exception:wrong-length, "map"): Update the expected exception for mapping over lists of different lengths. * libguile/srfi-1.h: * libguile/srfi-1.c: Remove map and for-each definitions. Remove the bit that extended the core `map' primitive with another method: the right way to do that is with modules. --- libguile/srfi-1.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'libguile/srfi-1.h') diff --git a/libguile/srfi-1.h b/libguile/srfi-1.h index 85aa65d0c..13ab067bd 100644 --- a/libguile/srfi-1.h +++ b/libguile/srfi-1.h @@ -39,8 +39,6 @@ SCM_INTERNAL SCM scm_srfi1_find_tail (SCM pred, SCM lst); SCM_INTERNAL SCM scm_srfi1_length_plus (SCM lst); SCM_INTERNAL SCM scm_srfi1_lset_difference_x (SCM equal, SCM lst, SCM rest); SCM_INTERNAL SCM scm_srfi1_list_copy (SCM lst); -SCM_INTERNAL SCM scm_srfi1_map (SCM proc, SCM arg1, SCM args); -SCM_INTERNAL SCM scm_srfi1_for_each (SCM proc, SCM arg1, SCM args); SCM_INTERNAL SCM scm_srfi1_assoc (SCM key, SCM alist, SCM pred); SCM_INTERNAL SCM scm_srfi1_partition (SCM pred, SCM list); SCM_INTERNAL SCM scm_srfi1_partition_x (SCM pred, SCM list); -- cgit v1.2.3