summaryrefslogtreecommitdiff
path: root/module/rnrs
diff options
context:
space:
mode:
Diffstat (limited to 'module/rnrs')
-rw-r--r--module/rnrs/lists.scm12
-rw-r--r--module/rnrs/records/syntactic.scm4
2 files changed, 11 insertions, 5 deletions
diff --git a/module/rnrs/lists.scm b/module/rnrs/lists.scm
index 812ce5f98..0671e7753 100644
--- a/module/rnrs/lists.scm
+++ b/module/rnrs/lists.scm
@@ -22,8 +22,7 @@
remv remq memp member memv memq assp assoc assv assq cons*)
(import (rnrs base (6))
(only (guile) filter member memv memq assoc assv assq cons*)
- (rename (only (srfi srfi-1) fold
- any
+ (rename (only (srfi srfi-1) any
every
remove
member
@@ -32,7 +31,6 @@
partition
fold-right
filter-map)
- (fold fold-left)
(any exists)
(every for-all)
(remove remp)
@@ -40,6 +38,14 @@
(member memp-internal)
(assoc assp-internal)))
+ (define (fold-left combine nil list . lists)
+ (define (fold nil lists)
+ (if (exists null? lists)
+ nil
+ (fold (apply combine nil (map car lists))
+ (map cdr lists))))
+ (fold nil (cons list lists)))
+
(define (remove obj list) (remp (lambda (elt) (equal? obj elt)) list))
(define (remv obj list) (remp (lambda (elt) (eqv? obj elt)) list))
(define (remq obj list) (remp (lambda (elt) (eq? obj elt)) list))
diff --git a/module/rnrs/records/syntactic.scm b/module/rnrs/records/syntactic.scm
index a497b90e3..bde6f9348 100644
--- a/module/rnrs/records/syntactic.scm
+++ b/module/rnrs/records/syntactic.scm
@@ -134,13 +134,13 @@
(let* ((fields (if (unspecified? _fields) '() _fields))
(field-names (list->vector (map car fields)))
(field-accessors
- (fold-left (lambda (x c lst)
+ (fold-left (lambda (lst x c)
(cons #`(define #,(cadr x)
(record-accessor record-name #,c))
lst))
'() fields (sequence (length fields))))
(field-mutators
- (fold-left (lambda (x c lst)
+ (fold-left (lambda (lst x c)
(if (caddr x)
(cons #`(define #,(caddr x)
(record-mutator record-name