From 6c76da4c32dd8a2c1f38d51df6e58dcc0b7cee11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 8 Apr 2010 23:55:41 +0200 Subject: [PATCH] Remove `fold' from (sxml fold). * module/sxml/fold.scm: Use (srfi srfi-1). (fold): Remove. (fold-values): Update docstring accordingly. * test-suite/tests/sxml.fold.test: Use (srfi srfi-1). --- module/sxml/fold.scm | 15 +++------------ test-suite/tests/sxml.fold.test | 1 + 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/module/sxml/fold.scm b/module/sxml/fold.scm index 4a39da050..0d2a5bc04 100644 --- a/module/sxml/fold.scm +++ b/module/sxml/fold.scm @@ -1,6 +1,6 @@ ;;;; (sxml fold) -- transformation of sxml via fold operations ;;;; -;;;; Copyright (C) 2009 Free Software Foundation, Inc. +;;;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. ;;;; Written 2007 by Andy Wingo . ;;;; ;;;; This library is free software; you can redistribute it and/or @@ -28,8 +28,8 @@ ;;; Code: (define-module (sxml fold) + #:use-module (srfi srfi-1) #:export (foldt - fold foldts foldts* fold-values @@ -50,15 +50,6 @@ (foldt fup fhere kid)) tree)))) -(define (fold proc seed list) - "The standard list fold. - -@var{proc} is of type a -> b -> b. @var{seed} is of type b. @var{list} -is of type [a]." - (if (null? list) - seed - (fold proc (proc (car list) seed) (cdr list)))) - (define (foldts fdown fup fhere seed tree) "The single-threaded tree fold originally defined in SSAX. @xref{sxml ssax,,(sxml ssax)}, for more information." @@ -89,7 +80,7 @@ tree rewrites. Originally defined in Andy Wingo's 2007 paper, tree))))) (define (fold-values proc list . seeds) - "A variant of @ref{sxml fold fold,,fold} that allows multi-valued + "A variant of @ref{SRFI-1 Fold and Map, fold} that allows multi-valued seeds. Note that the order of the arguments differs from that of @code{fold}." (if (null? list) diff --git a/test-suite/tests/sxml.fold.test b/test-suite/tests/sxml.fold.test index 121532fc2..6daa64953 100644 --- a/test-suite/tests/sxml.fold.test +++ b/test-suite/tests/sxml.fold.test @@ -24,6 +24,7 @@ (define-module (test-suite sxml-fold) #:use-module (test-suite lib) + #:use-module ((srfi srfi-1) #:select (fold)) #:use-module (sxml fold)) (define atom? (@@ (sxml fold) atom?))