Re: Augmenting Number.prototype with the functions from Math

2012-01-26 Thread Andrea Giammarchi
my point was: no need to have pow in Number.prototype, imo On Thu, Jan 26, 2012 at 1:40 AM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: On Jan 25, 2012, at 3:47 PM, Andrea Giammarchi wrote: Number.prototype.pow = function pow(radix) { return Math.pow(this, radix); };

Re: The global object should not be the global scope instance object

2012-01-26 Thread Andreas Rossberg
On 26 January 2012 01:11, Allen Wirfs-Brock al...@wirfs-brock.com wrote: The following proposal questions the validity of the teeshirt maxim Let is the new var as a rationale for treating global |let| declarations similarly to ES=5 global |var| declarations. While we want people to use |let|

Re: The global object should not be the global scope instance object

2012-01-26 Thread Andreas Rossberg
On 26 January 2012 17:47, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Jan 26, 2012, at 3:01 AM, Andreas Rossberg wrote: Overlapping imports? That's the first time I hear about that. That might be rather difficult, given that modules are recursive. It's just something I threw in that the

Re: The global object should not be the global scope instance object

2012-01-26 Thread Brendan Eich
Andreas Rossberg mailto:rossb...@google.com January 26, 2012 11:26 AM On 26 January 2012 17:47, Allen Wirfs-Brockal...@wirfs-brock.com wrote: On Jan 26, 2012, at 3:01 AM, Andreas Rossberg wrote: Overlapping imports? That's the first time I hear about that. That might be rather difficult, given

Re: Augmenting Number.prototype with the functions from Math

2012-01-26 Thread Xavier MONTILLET
Why would you write alert(2..pow(3)); // 8 ? You would simply write 8 right away... But when you work with numbers, they're stored in variables and it works : var a = 2; a.pow( 3 ); And anyway, you can still write (2).pow( 3 ); And about the possibility to implement them in pure JS, you

Re: Augmenting Number.prototype with the functions from Math

2012-01-26 Thread Brendan Eich
JS's Math namespace-object and its methods were modeled on JDK1.0 java.lang.Math. This won't change. I see little benefit and too much cost relative to it in duplicating (with curried |this|) the functions into Number.prototype. If there were a popular library that did this, it might help.

Re: The global object should not be the global scope instance object

2012-01-26 Thread Allen Wirfs-Brock
On Jan 26, 2012, at 11:51 AM, Brendan Eich wrote: Andreas Rossberg mailto:rossb...@google.com January 26, 2012 11:26 AM ... I still like the idea of cross-script shadowing (aka nested scopes), but one concern was that it is not clear what names would be in scope for, say, a piece of JS

Re: The global object should not be the global scope instance object

2012-01-26 Thread Allen Wirfs-Brock
On Jan 26, 2012, at 11:26 AM, Andreas Rossberg wrote: On 26 January 2012 17:47, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Jan 26, 2012, at 3:01 AM, Andreas Rossberg wrote: Overlapping imports? That's the first time I hear about that. That might be rather difficult, given that modules

Re: The global object should not be the global scope instance object

2012-01-26 Thread Brendan Eich
Allen Wirfs-Brock wrote: On Jan 26, 2012, at 11:51 AM, Brendan Eich wrote: We could say event handler attributes are scoped by the most-nested scope -- the scope due to the last script element that was closed before the element with the event handler attribute was processed. This means