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

Re: *-GET for dicts -- failure continuation versus default value

Taylor Campbell wrote:
Scott and I seem to disagree on this.  Here's a log of our debate about it
on IRC tonight:  (I'm Riastradh; Scott is FoxFire)

<Riastradh> Dictionaries' *-GET should take an optional failure continuation, not default value.

I would very much like to see *any* kind of function (promise, continuation, procedure) there rather than simply a default value.

The use of exceptions is a popular style. Also there are more exotic applications such as using a secondary retrieval on a cache failure.

I believe a procedure taking the arguments supplied to the original call (whether fold, get, update), although a bit ugly, would easily support any application need without a performance penalty when simply providing a fixed default value.

"I love deadlines. I love the whooshing sound they make as they fly by." -- Douglas Adams