manpagez: man pages & more
info guile
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.22.5.2 Usage

Scheme Procedure: foldt fup fhere tree

The standard multithreaded tree fold.

fup is of type [a] -> a. fhere is of type object -> a.

Scheme Procedure: foldts fdown fup fhere seed tree

The single-threaded tree fold originally defined in SSAX. See section SSAX: A Functional XML Parsing Toolkit, for more information.

Scheme Procedure: foldts* fdown fup fhere seed tree

A variant of foldts that allows pre-order tree rewrites. Originally defined in Andy Wingo’s 2007 paper, Applications of fold to XML transformation.

Scheme Procedure: fold-values proc list . seeds

A variant of fold that allows multi-valued seeds. Note that the order of the arguments differs from that of fold. See section Fold, Unfold & Map.

Scheme Procedure: foldts*-values fdown fup fhere tree . seeds

A variant of foldts* that allows multi-valued seeds. Originally defined in Andy Wingo’s 2007 paper, Applications of fold to XML transformation.

Scheme Procedure: fold-layout tree bindings params layout stylesheet

A traversal combinator in the spirit of pre-post-order. See section Transforming SXML.

fold-layout was originally presented in Andy Wingo’s 2007 paper, Applications of fold to XML transformation.

bindings := (<binding>...)
binding  := (<tag> <bandler-pair>...)
          | (*default* . <post-handler>)
          | (*text* . <text-handler>)
tag      := <symbol>
handler-pair := (pre-layout . <pre-layout-handler>)
          | (post . <post-handler>)
          | (bindings . <bindings>)
          | (pre . <pre-handler>)
          | (macro . <macro-handler>)
pre-layout-handler

A function of three arguments:

kids

the kids of the current node, before traversal

params

the params of the current node

layout

the layout coming into this node

pre-layout-handler is expected to use this information to return a layout to pass to the kids. The default implementation returns the layout given in the arguments.

post-handler

A function of five arguments:

tag

the current tag being processed

params

the params of the current node

layout

the layout coming into the current node, before any kids were processed

klayout

the layout after processing all of the children

kids

the already-processed child nodes

post-handler should return two values, the layout to pass to the next node and the final tree.

text-handler

text-handler is a function of three arguments:

text

the string

params

the current params

layout

the current layout

text-handler should return two values, the layout to pass to the next node and the value to which the string should transform.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on April 20, 2013 using texi2html 5.0.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.