set.delete method name

Carlos Prado García cpradog at me.com
Sun Feb 12 14:33:35 PST 2012


In many languages normally delete means destruction of the value and remove is used where the value is extracted from a list but the value remains.

El 12/02/2012, a las 22:43, Mark S. Miller escribió:

> I feel strongly that "delete" is the right name for this. Currently, all the method names (get, set, has, delete) relate directly to the names associated with these operations when applied to properties, making them more mnemonic. 
> 
> The need to say collection['delete'](...) rather than collection.delete(...) is only a temporary measure until the ES3 browsers fade out enough to either 1) be ignored, or 2) be supported only as the target of an ES5/6 -> ES3 translation. Granted this will take years. But we'll be living with these choices for many more years after that.
> 
> 
> On Sat, Feb 11, 2012 at 11:11 PM, Peter Michaux <petermichaux at gmail.com> wrote:
> The Set proposal has a "delete" method. Old ECMAScript implementations
> do not allow "delete" to appear as a bare method name like
> set.delete('foo') and it is necessary to write the awkward
> set['delete']('foo'). Because of this and knowing polyfills will be
> written to support Set in older implementations, would it be better to
> choose "remove" as the method name so that set.remove('foo') can be
> written in the older implementations? I think this would save a lot of
> unnecessary debugging for cross-browser programming.
> 
> Peter
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
> 
> 
> 
> -- 
>     Cheers,
>     --MarkM
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120212/65447349/attachment.html>


More information about the es-discuss mailing list