A read/write __proto__ that can vanish

2008-07-16 Thread Ingvar von Schoultz
. The underscores indicate nonstandard. -- Ingvar von Schoultz --- (My quirky use of capitals in code comes from my opinion that reserved and predefined words should all start with lowercase, and user-defined should all start with uppercase, because this will easily and elegantly prevent a host

Re: ES3.1 Object static methods rationale document

2008-07-16 Thread Ingvar von Schoultz
more descriptive and intuitive. -- Ingvar von Schoultz --- (My quirky use of capitals in code comes from my opinion that reserved and predefined words should all start with lowercase, and user-defined should all start with uppercase, because this will easily and elegantly prevent a host

Re: A read/write __proto__ that can vanish

2008-07-16 Thread Ingvar von Schoultz
be that the above syntax lock and hide [[Prototype]], while a different syntax for exotic use would allow the constructor added freedom. -- Ingvar von Schoultz --- (My quirky use of capitals in code comes from my opinion that reserved and predefined words should all start with lowercase

Re: ES3.1 Object static methods rationale document

2008-07-16 Thread Ingvar von Schoultz
@mozilla.org https://mail.mozilla.org/listinfo/es4-discuss ___ Es4-discuss mailing list Es4-discuss@mozilla.org https://mail.mozilla.org/listinfo/es4-discuss -- Ingvar von Schoultz --- (My quirky use of capitals in code comes from my

Re: ES3.1 Object static methods rationale document

2008-07-17 Thread Ingvar von Schoultz
.x-discuss mailing list [EMAIL PROTECTED] https://mail.mozilla.org/listinfo/es3.x-discuss -- Ingvar von Schoultz --- (My quirky use of capitals in code comes from my opinion that reserved and predefined words should all start with lowercase, and user-defined should all start with uppercase

Surprising semantics

2008-07-17 Thread Ingvar von Schoultz
I'm delighted with the many enticing improvements! But listing all the nice things here wouldn't make for interesting reading. And so it may sound much more negative than my overall delighted and enthusiastic feelings. -- Ingvar von Schoultz --- (My quirky use of capitals in code comes from

Re: ES3.1 Object static methods rationale document

2008-07-18 Thread Ingvar von Schoultz
Allen Wirfs-Brock wrote: Object.create's heritage is Doug Crockford's beget function and its primary purpose is to provide a more direct way to create an object with an explicitly specified prototype. I think the name Object.createHeir would clarify its use better. -- Ingvar von Schoultz

Re: Surprising semantics

2008-07-19 Thread Ingvar von Schoultz
that. Waldemar Ingvar von Schoultz wrote: These are some impressions looking at what I expect from the language, and how some things in the specification can cause confusion. I would have contributed here during the discussions, but I discovered the mailing lists just a couple

Re: Opt-in versioning

2008-07-19 Thread Ingvar von Schoultz
/listinfo/es4-discuss -- Ingvar von Schoultz --- (My quirky use of capitals in code comes from my opinion that reserved and predefined words should all start with lowercase, and user-defined should all start with uppercase, because this will easily and elegantly prevent a host of name-collision

Re: Opt-in versioning

2008-07-21 Thread Ingvar von Schoultz
find this more palatable? if { local stuff } if [ no local stuff ] This would require good syntax coloring. It wouldn't work in old browsers. Personally I prefer the double braces. -- Ingvar von Schoultz --- (My quirky use of capitals in code comes from

Re: Surprising semantics

2008-07-21 Thread Ingvar von Schoultz
... const d:c = ... // Conditional definition requires variable types to be evaluated at run-time, which is not somewhere we want to go in the first version I don't know of anyone here who wants to support something like that. Waldemar Ingvar von Schoultz wrote: These are some

{{ ... }} -- Was: Re: Surprising semantics

2008-07-22 Thread Ingvar von Schoultz
to {{ }}. It doesn't apply when you use {{ }} and everything becomes let. I'll reply about that in a separate email. And to avoid the above mixing and confusion, I'll put it aside for a while. Let's reduce the confusion. Ingvar Ingvar von Schoultz wrote: I'm astonished that you interpreted my

function hoisting like var -- Was: Re: Surprising semantics

2008-07-24 Thread Ingvar von Schoultz
was a const or function, which would snowball into a complex mess. Unrelated, I believe. Ingvar Ingvar von Schoultz wrote: I'm astonished that you interpreted my text in such a weird way! That's completely foreign to JavaScript! var is always unconditional in JavaScript. An if() before

Re: function hoisting like var

2008-07-25 Thread Ingvar von Schoultz
, the change that small. By the way, your translation (function() { code })() can also be expressed as new function() { code } Less parentheses! (But I haven't explored possible drawbacks.) -- Ingvar von Schoultz --- (My quirky use of capitals in code comes from my opinion

Re: function hoisting like var

2008-07-25 Thread Ingvar von Schoultz
write: function { }(); Regards, Igor ___ Es4-discuss mailing list Es4-discuss@mozilla.org https://mail.mozilla.org/listinfo/es4-discuss -- Ingvar von Schoultz --- (My quirky use of capitals in code comes from my opinion that reserved

Re: function hoisting like var

2008-07-25 Thread Ingvar von Schoultz
[EMAIL PROTECTED] wrote: Ingvar von Schoultz wrote: [EMAIL PROTECTED] wrote: I'm trying to keep the language relatively simple. You can't get away from supporting this: { function a(){} var b = a; } What do you mean? This is a syntax error in both ES3 and ES3.1

Re: function hoisting like var

2008-07-26 Thread Ingvar von Schoultz
Igor Bukanov wrote: 2008/7/26 Ingvar von Schoultz [EMAIL PROTECTED]: Do you really think {{ }} appears in existing code, correctly enclosing statement blocks, with the {{ and the }} placed tightly together both at the beginning and at the end? Yes: I have seen the code like if (x

Re: function hoisting like var

2008-07-26 Thread Ingvar von Schoultz
the above code and functionality. In other words, complexity is not a problem. ES4 can easily choose whatever semantics people prefer. -- Ingvar von Schoultz --- (My quirky use of capitals in code comes from my opinion that reserved and predefined words should all start with lowercase

Re: function hoisting like var

2008-07-26 Thread Ingvar von Schoultz
Sorry about the length of this, but I'm trying to cover the unclear things, and often I don't know which things are unclear. Brendan Eich wrote: On Jul 26, 2008, at 2:07 PM, Ingvar von Schoultz wrote: You can't get away from supporting this: { function a(){} var

Re: function hoisting like var

2008-07-27 Thread Ingvar von Schoultz
Brendan Eich wrote: On Jul 26, 2008, at 2:06 PM, Ingvar von Schoultz wrote: How sad! It seemed such a simple and intuitive notation! Opinions vary, but all the ones I heard at the Ecma TC39 meeting found it neither simple nor intuitive, and some abhorred it on aesthetic grounds

Re: function hoisting like var

2008-07-27 Thread Ingvar von Schoultz
Mike Shaver wrote: On Sun, Jul 27, 2008 at 7:51 PM, Ingvar von Schoultz [EMAIL PROTECTED] wrote: Igor Bukanov wrote: eval('[]') is a valid and, in fact, useful ES3 code. Similarly eval('{[]}'). Yes, and by my rules they both create and return a new, empty array, which is intuitively

Re: function hoisting like var

2008-07-27 Thread Ingvar von Schoultz
Igor Bukanov wrote: 2008/7/28 Ingvar von Schoultz [EMAIL PROTECTED]: If [...] is preceded by =, or enclosed in ( ), or in some other position where you can't have a block, it's a literal. If it's a literal it must contain a comma-separated list of values, so if the syntax doesn't match

Re: function hoisting like var

2008-07-27 Thread Ingvar von Schoultz
Richard Cornford wrote: Ingvar von Schoultz wrote: Igor Bukanov wrote: 2008/7/28 Ingvar von Schoultz wrote: snip Any of this can be a valid ES3 code as [] always means an array literal. I get the impression that disambiguation would be easy. eval('[]') is a valid and, in fact, useful ES3

Re: function hoisting like var

2008-07-27 Thread Ingvar von Schoultz
Mike Shaver wrote: On Sun, Jul 27, 2008 at 9:15 PM, Ingvar von Schoultz [EMAIL PROTECTED] wrote: Does it matter whether it's interpreted as an empty block or an empty discarded array? It's not always discarded: js var x = 1 js eval (if (x) [1, 2, 3]) 1,2,3 That becomes an array

Re: function hoisting like var

2008-07-27 Thread Ingvar von Schoultz
Richard Cornford wrote: Ingvar von Schoultz wrote: Richard Cornford wrote: snip { 1,2,3,4,5 } - is a valid ES 3 Program (even if a pointless one); A Block statement containing an Expression statement (with automatic semi-colon insertion making the Expression statement

Re: function hoisting like var

2008-07-27 Thread Ingvar von Schoultz
Igor Bukanov wrote: 2008/7/28 Ingvar von Schoultz [EMAIL PROTECTED]: {{ }} is just the same as a scoping function used on ES3: (function() { code })() As Lars Hansen has pointed out any proposal for a shorthand for (function() { code })() has to deal with break/continue/return inside

Re: function hoisting like var

2008-07-28 Thread Ingvar von Schoultz
Ingvar von Schoultz wrote: In theory {{ code }} could be converted to a function that returns information about whatever break/continue/return was reached. But I'd be quite surprised if that is easy. Something like this. Written with syntax sugar: Outer: for (var OutName

A simple translation of the scoping-block syntax sugar -- Was: Re: function hoisting like var

2008-07-29 Thread Ingvar von Schoultz
. For a description of the translation, see the quoted text below. Ingvar Ingvar von Schoultz wrote: Ingvar von Schoultz wrote: In theory {{ code }} could be converted to a function that returns information about whatever break/continue/return was reached. I now think this could be made very simple

Re: A simple translation of the scoping-block syntax sugar -- Was: Re: function hoisting like var

2008-07-29 Thread Ingvar von Schoultz
keyword. -- Ingvar von Schoultz --- (My quirky use of capitals in code comes from my opinion that reserved and predefined words should all start with lowercase, and user-defined should all start with uppercase, because this will easily and elegantly prevent a host of name-collision problems

Re: A simple translation of the scoping-block syntax sugar -- Was: Re: function hoisting like var

2008-07-29 Thread Ingvar von Schoultz
and to satisfy those who prefer the let and var combination. -- Ingvar von Schoultz --- (My quirky use of capitals in code comes from my opinion that reserved and predefined words should all start with lowercase, and user-defined should all start with uppercase, because this will easily

Re: A simple translation of the scoping-block syntax sugar -- Was: Re: function hoisting like var

2008-07-29 Thread Ingvar von Schoultz
governing for(), while() or switch() goes here. { // The code between {{ }} goes here. } return _EndOfBlock; }).call (this, arguments); if (_ReturnValue != _EndOfBlock) return _ReturnValue; Ingvar Ingvar von Schoultz wrote: The simple

Re: function hoisting like var

2008-07-30 Thread Ingvar von Schoultz
could have explained some of the things below better, making them clearer. Should I post better explanations? I'm really very curious about that rebinding problem! Both what it means, and where I seem to propose it (or actually propose it, inadvertently). Ingvar Ingvar von Schoultz wrote

Re: A simple translation of the scoping-block syntax sugar -- Was: Re: function hoisting like var

2008-07-30 Thread Ingvar von Schoultz
Ingvar von Schoultz wrote: Any variable that you declare anywhere will simply splash out of any { } and attach itself to the nearest surrounding {{ }}, becoming visible in the entire space between them. Int this splashing out of { }, function declarations are a special case. Although

Re: function hoisting like var

2008-08-01 Thread Ingvar von Schoultz
limitation, certainly not a showstopper. -- Ingvar von Schoultz ___ Es4-discuss mailing list Es4-discuss@mozilla.org https://mail.mozilla.org/listinfo/es4-discuss

Re: function hoisting like var

2008-08-06 Thread Ingvar von Schoultz
} functionality at all in ES3.1. -- Ingvar von Schoultz ___ Es4-discuss mailing list Es4-discuss@mozilla.org https://mail.mozilla.org/listinfo/es4-discuss

Picking property by attribute

2008-08-08 Thread Ingvar von Schoultz
an alternate syntax, more logical but less readable in my opinion: var x = myDict .:enumerable .someName; var x = myDict .!enumerable .toString(); -- Ingvar von Schoultz ___ Es4-discuss mailing list Es4-discuss@mozilla.org https://mail.mozilla.org

Re: Picking property by attribute

2008-08-10 Thread Ingvar von Schoultz
.toString(); -- Ingvar von Schoultz ___ Es4-discuss mailing list Es4-discuss@mozilla.org mailto:Es4-discuss@mozilla.org https://mail.mozilla.org/listinfo/es4-discuss -- Ingvar von Schoultz --- (My unusual use

Old documents marked New

2008-08-13 Thread Ingvar von Schoultz
On the page http://www.ecmascript.org/docs.php three documents are marked New!, but the documents are from October and November. -- Ingvar von Schoultz ___ Es4-discuss mailing list Es4-discuss@mozilla.org https://mail.mozilla.org/listinfo/es4-discuss