Side-effects of some Array methods ...
dhtmlkitchen at gmail.com
Fri Jun 27 22:18:11 PDT 2008
On Fri, Jun 27, 2008 at 3:57 PM, Brendan Eich <brendan at mozilla.org> wrote:
> On Jun 27, 2008, at 3:45 PM, Garrett Smith wrote:
>> to list ->
> I am not the one replying to sender only -- all of my replies to you have
> cc'ed the list.
I know. I had a mistake and hit 'Reply'. Then, realizing that, I put
the message back on the list.
> You have replied twice to me only, then resent as
> reply-alls. What mailer are you using?
Sorry, it was an accident. I meant to put it on the list and hit
'Reply'. I would not mind if you mail me personally. I just had a
I'm using GMail. I need a web based mailer because I use multiple
machines and usually mobile. I'm open to suggestions for a better
mailer or alternative to gmail.
> My shell example is not the "parades" plural referenced above, merely a demo
> of fail-soft behavior. The unknown web scripts that might depend on that
> behavior could be doing useful work based on the current semantics ("having
Your point seemed clear (at least to me). I know the idiom "rain on
their parade". It is possible that someone expects that behavior , and
in fact, that behavior is guaranteed by the current spec.
>> How do you address these concern? Is it better to fail fast or fail
>> later? If later, and in the case or attempting to set a ReadOnly
>> property, then should the failure be silent? (String example). What
>> about the NodeList example?
> This is not a green-field design exercise. My point is that browsers do what
> ES1-3 said (depending on the Array method; generics were there all along,
> but some were added IIRC after ES1). Code tends to depend on detailed
> semantics (not always, but more often than you'd think). Why rock the boat?
I'm just trying to figure out what the best way to handle error
condition. It's somewhat related to what Pratap brought up:
| The side effect is as follows:
| if "this" does not have a "length" property, it ends up getting one;
| if "this" does have a length property, but is not an Array, that
| "length" property will get updated.
| What is the rationale for this?
Leads to thinking about API design.
I guess it's not bad the way it is. Anyone calling pop() on a NodeList
can get what should be expected. OTOH, maybe it's worth considering if
a better alternative exists.
What is a green-field design exercise?
More information about the Es4-discuss