Re: Side-effects of some Array methods ...

2008-06-27 Thread Brendan Eich
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. You have replied twice to me only, then resent  
as reply-alls. What mailer are you using?


 Again, we don't know what failing faster (you mean throwing a new  
 error as
 an exception) would break. The shell session above shows how fail- 
 soft could
 leave scripts executing and even behaving well. Throwing an  
 exception that's
 not caught would rain on such scripts' parades.

 I hardly call that a parade. It looks like a toy program aimed at

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 parades).


 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?

/be

___
Es4-discuss mailing list
Es4-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss


Re: Side-effects of some Array methods ...

2008-06-27 Thread Garrett Smith
On Fri, Jun 27, 2008 at 3:57 PM, Brendan Eich [EMAIL PROTECTED] 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
mistake.

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.

[snip]


 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
 parades).


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?

Garrett

 /be
___
Es4-discuss mailing list
Es4-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss


Re: Side-effects of some Array methods ...

2008-06-27 Thread Brendan Eich
On Jun 27, 2008, at 10:18 PM, Garrett Smith wrote:

 What is a green-field design exercise?

Sorry for the confusing phrase -- I should have written it's not a  
clean-slate design opportunity.

/be

___
Es4-discuss mailing list
Es4-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss