Re: Improving ECMAScript as a compilation target

2009-05-06 Thread Brendan Eich
On May 5, 2009, at 6:53 PM, Allen Wirfs-Brock wrote: Still does not connote non-existent. If all these handlers are only invoked in missing property situations then we can probably get away with an implicitly non- existent connotation. The ones that want to be called for existent

Re: Operators ||= and =

2009-05-06 Thread David-Sarah Hopwood
liorean wrote: On Tue, May 5, 2009 at 11:37 AM, Peter Michaux petermich...@gmail.com wrote: function(a=1, b=defaultVal); And in this syntax will default values be used if the parameter is falsey or only if it is undefined? 2009/5/5 Mark S. Miller erig...@google.com: Or only if it is

Catchall proposal

2009-05-06 Thread David-Sarah Hopwood
Brendan Eich wrote: [...] I finally found time to write up a proposal, sketchy and incomplete, but ready for some ever-lovin' es-discuss peer review ;-). http://wiki.ecmascript.org/doku.php?id=strawman:catchalls # Catchalls are sometimes thought of as being called for every # access to a

Re: Catchall proposal

2009-05-06 Thread David-Sarah Hopwood
David-Sarah Hopwood wrote: Brendan Eich wrote: [...] I finally found time to write up a proposal, sketchy and incomplete, but ready for some ever-lovin' es-discuss peer review ;-). http://wiki.ecmascript.org/doku.php?id=strawman:catchalls # Catchalls are sometimes thought of as being

Re: Catchall proposal

2009-05-06 Thread Brendan Eich
On May 6, 2009, at 9:37 AM, Mark S. Miller wrote: Note that the translation-basis of Valija, WebSandbox, and FBJS2 is a distinct issue, since the goal there is to instantiate multiple emulated global environments within a single actual global environment. Catchalls may or may not help here as

Re: Catchall proposal

2009-05-06 Thread Mark S. Miller
On Wed, May 6, 2009 at 10:11 AM, Brendan Eich bren...@mozilla.com wrote: Let's cut to the chase if we can. I don't buy the SES first, since it's not clear SES is usable but Web Sandbox and others like it are already in use. For the record, other like it are indeed already in use (FBJS[2?] on

Re: Operators ||= and =

2009-05-06 Thread Peter Michaux
On Tue, May 5, 2009 at 2:59 PM, Brendan Eich bren...@mozilla.com wrote: On May 5, 2009, at 11:37 AM, Peter Michaux wrote: On Mon, May 4, 2009 at 10:26 PM, Brendan Eich bren...@mozilla.com wrote: People often write the following at the beginning of functions for optional parameters  

Re: Operators ||= and =

2009-05-06 Thread Brendan Eich
On May 6, 2009, at 11:07 AM, Peter Michaux wrote: A lot of people don't understand JavaScript falsey value equality and since || works in their server-side language they assume it works the same way in JavaScript. It compiles and runs after all! ;-) Compiling and running is often all that's

Re: Catchall proposal

2009-05-06 Thread Brendan Eich
On May 6, 2009, at 10:53 AM, Mark S. Miller wrote: On Wed, May 6, 2009 at 10:11 AM, Brendan Eich bren...@mozilla.com wrote: Let's cut to the chase if we can. I don't buy the SES first, since it's not clear SES is usable but Web Sandbox and others like it are already in use. For the

Spawn proposal strawman

2009-05-06 Thread Mark S. Miller
On Wed, May 6, 2009 at 10:53 AM, Mark S. Miller erig...@google.com wrote: [...] For the Valija-like level, I think the most important enabler would be some kind of hermetic eval or spawn primitive for making a new global context (global object and set of primordials) whose connection to the

Re: Operators ||= and =

2009-05-06 Thread Mark S. Miller
On Wed, May 6, 2009 at 12:42 PM, Brendan Eich bren...@mozilla.com wrote: Current position: long default parameter values, short ||= and ??=. I like that. The great virtue of ||= is that it can be explained as repairing a non-orthogonality, thereby making the language *simpler* to explain. But

Re: Catchall proposal

2009-05-06 Thread Mark S. Miller
On Wed, May 6, 2009 at 12:55 PM, Brendan Eich bren...@mozilla.com wrote: Your taxonomy is not shared by everyone, and it contains assumptions I've questioned. Of course. I'm trying to open discussion of these, not end discussion. Please question away. I'd rather start from real-world

Re: Operators ||= and =

2009-05-06 Thread Edward Lee
On Tue, May 5, 2009 at 1:37 PM, Peter Michaux petermich...@gmail.com wrote: I think optional parameters are the nuisance use case that is fueling any discussion about a ||= or ??= operator. There are other uses that are similar, but wouldn't be covered by default args. Here's one simple example:

Re: Catchall proposal

2009-05-06 Thread Brendan Eich
On May 6, 2009, at 1:14 PM, Mark S. Miller wrote: I'd rather start from real-world use-cases wherever they may be. Caja on YAP is a deployed real world use case of Valija layered on Cajita. Cool, you know more about it than I do -- what does it want from catchalls that's not there? What

Re: Catchall proposal

2009-05-06 Thread Mark S. Miller
On Wed, May 6, 2009 at 12:55 PM, Brendan Eich bren...@mozilla.com wrote: [...] This is a big topic, I'll save it for another day. [...] But again this is a bigger topic than catchalls and I will shut up for now. Language design is, among many other things, a form of search in a large

Re: Operators ||= and =

2009-05-06 Thread Ash Berlin
I don't think ||= and ??= are very difficult to define clearly. Perhaps just a line each in terms of the expanded syntax. I don't think they would add much bloat to engines. Perhaps just better to add them both and move on to discussing classes, lambdas, or processes. a ||= b; a = a || b;

Re: Operators ||= and =

2009-05-06 Thread Neil Mix
On May 6, 2009, at 4:53 PM, Ash Berlin wrote: You could make a case for adding a ?? operator for symmetry. Example of usage: some_func(a, b ?? c ); Roger that, given ??= it would be strange to leave out ??. I'm still trying to leave out both ;-). /be I'm quite partial to an

Re: Operators ||= and =

2009-05-06 Thread Brendan Eich
On May 6, 2009, at 3:13 PM, Neil Mix wrote: On May 6, 2009, at 4:53 PM, Ash Berlin wrote: You could make a case for adding a ?? operator for symmetry. Example of usage: some_func(a, b ?? c ); Roger that, given ??= it would be strange to leave out ??. I'm still trying to leave out both

Catchall invocation for 'null' and 'undefined' (or: how to be a disruptive influence in 3 easy steps)

2009-05-06 Thread William Edney
All - Well, Sister Eugenia always did say I was a disruptive influence in grade school - guess I haven't changed much :-). Let me throw another idea into the mix and churn the pot a bit more. Many moons ago when I was a Smalltalker, I always liked the fact that 'nil' in Smalltalk was a