core :: MapRead :: provide_default_value
[]
to provide a default value when a key
has no valueBy default the behavior is to abort.
Note: the value is returned as is, implementations may want to store the value in the map before returning it @toimplement
# Called by the underling implementation of `[]` to provide a default value when a `key` has no value
# By default the behavior is to abort.
#
# Note: the value is returned *as is*, implementations may want to store the value in the map before returning it
# @toimplement
protected fun provide_default_value(key: nullable Object): V do abort
lib/core/collection/abstract_collection.nit:633,2--638,70
redef fun provide_default_value(key) do
var res = new Array[V]
self[key] = res
return res
end
lib/more_collections/more_collections.nit:63,2--67,4
redef fun provide_default_value(key) do return default
lib/more_collections/more_collections.nit:348,2--55