[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: collection classes



> Date: Fri, 4 Dec 1992 18:12:25 +0100
> From: Jonathan Bachrach <Jonathan.Bachrach@ircam.fr>
> 
> I've implemented the collection classes and have the following wish list:
> ....
>  The following insertion function's are very useful for many sequences classes
>  (like gap-list's).  It is difficult to write many of the sequence methods 
>  because `add' does not specify where the new-element is inserted.
> 
>  (define-generic-function insert (sequence new-element insertion-position))
>  (define-generic-function insert! (mutable-sequence new-element insertion-position))
>  (define-generic-function insert-sequence 
>      (sequence insertion-sequence insertion-position))
>  (define-generic-function insert-sequence!
>      (mutable-sequence insertion-sequence insertion-position))
> ....
>   (define-generic-function concatenate! (mutable-sequence #rest rest-sequences))

I believe all of these are subsumed by an improved version of replace-subsequence! that 
we are thinking about and will probably adopt.  I like the idea of one function doing the 
work of five.

>   I would also like to see the following destructively functions added:
>   (define-generic-function choose! (predicate mutable-sequence))
>   (define-generic-function choose-by! (predicate test-sequence mutable-value-sequence))

I don't understand what you propose these will do.

> ....
>   There seems no reason to me why a setter was not provided for `last':
>   (define-generic-function (setter last) (new-value mutable-sequence)) 

Good point, I think we should add this.  By the way in Dylan the new-value
argument goes at the end.

>   I would like to see <table> take `test:' as an init-keyword:
>   (make <table> #key (test =))

In general this is a good idea but there are a lot of very complex issues
associated with it and we would need to see a specific proposal.