Re: node-list-filter, node-list-map return a reversed result

Subject: Re: node-list-filter, node-list-map return a reversed result
From: Tony Graham <tgraham@xxxxxxxxxxxxxxxx>
Date: Tue, 28 Apr 1998 17:43:16 -0400 (EDT)
At 28 Apr 1998 14:34 +0200, Heiko Kirschke wrote:
 > the definition of node-list-filter as given in the DSSSL
 > specification in section 10.2.2:
...
 > returns a proper node list, but the node list is reversed w.r.t. the
 > source list passed in argument `nl'. To keep the ordering of the
 > source list, its definition should be changed to:
 > 
 > (define (my-node-list-filter proc nl)
 >   (node-list-reduce nl
 > 		    (lambda (result snl)
 > 		      (if (proc snl)
 > 			  (node-list result snl)
 > 			  result))
 > 		    (empty-node-list)))
 > 
 > Assuming that (node-list) does a destructive concatenation of its
 > arguments, the definition given in the DSSSL specification will run
 > faster than the latter one.
 > 
 > Same considerations hold for (node-list-map).
 > 
 > BTW, is this a bug or not? From section 10.1.2 can be deduced that
 > node-lists are ordered (otherwise they would have been named
 > `node-sets', I guess). 

These bugs have been reported before.  The DSSSL procedure library
(http://www.mulberrytech.com/dsssl/dsssldoc/procedures/) also includes
corrected versions.

Regards,


Tony Graham
=======================================================================
Tony Graham
Mulberry Technologies, Inc.                         Phone: 301-315-9632
17 West Jefferson Street, Suite 207                 Fax:   301-315-8285
Rockville, MD USA 20850                 email: tgraham@xxxxxxxxxxxxxxxx
=======================================================================


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


Current Thread