How to Collect Sosofos?

Subject: How to Collect Sosofos?
From: "W. Eliot Kimber" <eliot@xxxxxxxxxx>
Date: Tue, 09 Sep 1997 09:49:12 -0500
I think I must be missing something obvious, but I've run into a puzzle
that I can't figure out.

What I think I want to do is iterate over a node list and generate a bunch
of sosfos (using make formatting-instruction in this case).  My puzzle is
how to end the iteration and also return the appended sosofos.  I'm trying
to write DSSSL specs to generate various views of groves, starting with a
canonical grove representation (CGR) document generator.  My main
processing loop needs to iterate over each property of a node and return
the sosofos that result from translating the node property into CGR
elements, something like this:

(define (process-props node
  (let ((propnames (split (node-property 'allpns node))))
    (sosofo-append 
      (let loop ((propnames propnames))
        (if (null? propnames)
          (what do I return here?)
          (sosofo-append
            (process-property (car propnames))
            (loop (cdr propnames))))))))

What I can't figure out is what I return for the IF inside the loop--my
understanding is that the result of this loop would always be the empty
sosofo, not the sosofos appended by the false branch.

I guess what I'm looking for is some kind of "for-each" function that can
return a list of sosofos or a way to accumulate sosofos explicitly.

Have I missed some obvious DSSSL feature or is there no way to do what I
want out of the box? (My next approach would be to write code on the
groveoa.dll directly, but I thought I'd try DSSSL first.)

Thanks,

Eliot


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread