Re: map-constructor

Subject: Re: map-constructor
From: James Clark <jjc@xxxxxxxxxx>
Date: Fri, 14 Nov 1997 07:10:49 +0700
Richard Light wrote:
> 
> I haven't seen any 'home-grown' versions of map-constructor in my
> ramblings through the DSSSList archive, so I cooked up the following:
> 
> (define (map-constructor proc n1)
>   (node-list-reduce n1
>     (lambda (result sn1)
>       (sosofo-append result (apply proc (list sn1)))
>     )
>     (empty-sosofo)
>   )
> )
> 
> This reflects what I understand to be the function of map-constructor,
> and it certainly does what I was hoping it would do in my particular
> application.
> 
> Could someone who knows a bit more than me about DSSSL check this out,
> and advise whether it is ok?

It's not.  The procedure is supposed to be a procedure with no
arguments, and for each node map-constructor calls it in such a way that
(current-node) would return that node. This is not implementable in
terms of other primitives.

James



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


Current Thread