[m-dev.] diff: better unsorted_aggregate/4

Peter Schachte pets at students.cs.mu.oz.au
Mon Sep 29 11:27:16 AEST 1997


On Mon, 29 Sep 1997, Peter Schachte wrote:

> So here's a proposed algorithm:
> 
> 	1.  Call the generator closure, building a solution on the heap.
> 	2.  Swap (the runtime systems conception of) the heap and solutions
> 	    heap.
> 	3.  Call the collector closure, passing the "collection so far" and
> 	    the new solution, storing it as the new "collection so far."
> 	4.  Deep copy the "collection so far" to the solutions heap (which
> 	    is now thought of as the heap).  Since it was built on the
> 	    solutions heap, only the parts of the new solution which have
> 	    become part of the collection so far actually need to be copied.
> 	5.  Swap the heap and solutions heap back.
> 	6.  Force a failure, and return to 2 for each new success.
> 	7.  Return the collection so far as the aggregate.

Oops.  That should read:

	7.  Deep copy the collection so far back to the heap as the result,
	    and reset the solutions heap.


-Peter Schachte      URL:  http://www.cs.mu.oz.au/~pets/
pets at cs.mu.OZ.AU     PGP:  finger pets at 128.250.37.150 for key
    Do insects spend hours demammaling their programs?




More information about the developers mailing list