A different semantics for WeakMap#get default value
herby at mailbox.sk
Tue Jan 17 03:45:27 PST 2012
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 ;-).
with dflt being mandatory?
Still there is question of laziness of dflt, the original
#get:ifAbsentPut: has the block as its second argument.
> es-discuss mailing list
> es-discuss at mozilla.org
More information about the es-discuss