mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-29 19:30:36 +02:00
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).
This commit is contained in:
parent
e39d0b7668
commit
6c76da4c32
2 changed files with 4 additions and 12 deletions
|
@ -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 <wingo at pobox dot com>.
|
||||
;;;;
|
||||
;;;; 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)
|
||||
|
|
|
@ -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?))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue