Brendan Eich wrote:
Clearly(!) a set-if-not-present method should not be misnamed "get".
I like the optional sentinel-meaning-not-found for get, and setDefault
per Python as Tab pointed out. Agree they should not be merged into one
API. Bikeshedding setDefault at leisure (in background in my head ;-).
Like:
getIfAbsentSet(key, dflt)
with dflt being mandatory?
Still there is question of laziness of dflt, the original
#get:ifAbsentPut: has the block as its second argument.
/be
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss