lib: add `provide_default_value` in Map to allow subclasses to provide
authorJean Privat <jean@pryen.org>
Tue, 4 Mar 2014 17:03:06 +0000 (12:03 -0500)
committerJean Privat <jean@pryen.org>
Wed, 5 Mar 2014 15:32:25 +0000 (10:32 -0500)
commit0cb25f89796abd6673614f6070072cb6ae2cd861
tree6c5a6617119953298fa986c737307cebb3658dd9
parentac50e59ae8065ed5cdf56a0923c6957a77cf2091
lib: add `provide_default_value` in Map to allow subclasses to provide
specific behavior when there is no value associated with a key.

The default behavior is to abort, as usual.

Basically this patch factorizes the `abort` in a single function that can
be redefined.

Signed-off-by: Jean Privat <jean@pryen.org>
lib/standard/collection/abstract_collection.nit
lib/standard/collection/array.nit
lib/standard/collection/hash_collection.nit