string-list-sosofo

Name

string-list-sosofo -- Build sosofo from a list of strings and an associative list

Synopsis

(string-list-sosofo string-list assoc-list)

Description

Take a list of strings and an associative list that maps strings to sosofos and return an appended sosofo.

(This function is used for a particular task in the DocBook stylesheets. It may not be particularly general, but its in dblib.dsl' because there is nothing DTD-specific about it.)

Example

Given the string list ("what is " "1" " " "+" " " "1") and the associative list (("1" (literal "one")) ("2" (literal "two")) ("+" (literal "plus"))), (string-list-sosofo) returns the sequence of sosofos equivalent to (literal "what is one plus one").

Author

Norman Walsh, <ndw@nwalsh.com>

Source Code

(define (string-list-sosofo string-list assoc-list)
  ;; Build sosofo from a list of strings and an associative list
  (if (null? string-list)
      (empty-sosofo)
      (sosofo-append (match-substitute-sosofo (car string-list) assoc-list)
		     (string-list-sosofo (cdr string-list) assoc-list))))