Le 10/11/2013 22:42, Brendan Eich a écrit :
On Nov 10, 2013, at 9:24 PM, David Bruant <bruan...@gmail.com> wrote:
WebIDL creates spec, not code. The language syntax doesn't need to evolve for 
that.
Wrong, webidl and jsidl (and jsil and embind) are both interface and a bit of 
implementation. Testing argc != testing sentinel value. Two different 
semantics, plausibly deserving fast and terse syntax.
One of the semantics is admitted as a bad practice. I still don't understand why it should be encouraged. Other use cases are compile-to-JS use case. Can implementations optimize the pattern Allen showed in his initial post?
    function splice(...actualArgs) {
        let [start, stop, ...item] = actualArgs;
        ...
        if (actualArgs.length == 0) {...

Allen showed that rest params+destructuring allows self
Read Allen's replies, stop ignoring known counter-arguments.
Not my intention, sorry it came out this way, I had missed a few posts.

Allen wrote:
So, if a lot of DOM APIs need to be implemented as function (...args) {

then that is likely what will appear in documentation.
As Mark said, generate doc from WebIDL. Else, MDN and WPD are CC-licenced wikis :-)

Also note that there is likely to be actual computational overhead in both creating a rest argument and in destructuring it. In some cases, that overhead may be an issue.
Can implementations optimize this pattern to remove this overhead?

David
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to