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

Re: [oleg@xxxxxxxxx: Minor quibbles on the latest draft]



On Thu, Jul 31, 2003 at 09:32:59AM +0200, Jens Axel S?gaard wrote:
> >(define (myfunc a)
> > (set-contains? a 3))
> >
> >(myfunc (foo-set 1 2 3))
> >(myfunc (bar-set 4 5 6))
> >
> For two reasons I prefer the naming make-mydict, mydict-get.
> First, if I need a dictionary often it is unimportant how it is implemented,
> second, I can change the implementation easyly as Oleg describes.
> 
> Whether the implementation is able to make automatic dispath on the
> type of set in set-contains? is not /that/ important (to mee). My 
> intution says
> that it's relatively seldom one needs to use more than one implementation
> at a time (but it can happen).

I see this more frequently than you'd think.  Its not so much that *you* 
would write code that uses two collections of the same type, but it 
happens frequently when joining in modular code from more than one 
subsystem, especially where that system publishes an API which you write 
for where you need to be deliberately unaware of certain implementation 
details.  This is especially important for maintenance of the resulting 
system.  Especially as Scheme systems start (and continue) to offer 
compiled modules, programmers or sysadmins may want to upgrade package 
Foo.  If Foo changes its selection of the underlying set collection, it 
would be onerous to require all packages that depend on it to be 
modified at the source code level to remain compatible.

I'm pretty confident that allowing truely collection agnostic code is 
quite necessary.

	Scott

Attachment: pgpTywzaNUSRb.pgp
Description: PGP signature