Re: Re: Inline ES Modules

2018-06-18 Thread Peter van der Zee
I actually quite like the idea. - Extend the import syntax to allow an identifier instead of a string. Such identifier must be match the name of a module declaration the same file (they are hoisted and a syntax error if not present/something else). - Module declaration names are abstracts since th

Re: try/catch/else

2018-02-08 Thread Peter van der Zee
>> On Thu, Feb 8, 2018 at 10:13 AM, Claude Pache >> wrote: >>> >>> What about the following pattern (labelled block + break)? >>> >>> ```js >>> processSuggestions: { >>> let suggestions; >>> try { >>> suggestions = await fetchSuggestions(); >>> } catch (e) { >>> alert('Fail

Re: Mixing grammars

2017-09-01 Thread Peter van der Zee
> Sorry, but your message looks very opinionated and I can't seem to find any objective reasoning in there. Nah, you might be thrown off by the different grammar ;) Ok. Thing is, `|>` would introduce a new way of calling a function in a way that is not at all in line with how functions are calle

Mixing grammars

2017-09-01 Thread Peter van der Zee
I want quickly a point to make. I have a while ago of the, well, I know actually not how that thing is called, but the "|> operator" heard. I ignored it as "funny but a very different paradigm than JS". Now see I today a tweet pass by that somebody a draft of a propasal has created [1] to this rea

Re: Arrow function followed by divide or syntax error?

2017-05-24 Thread Peter van der Zee
is none in this example, nor a line > break that would allow one to be inserted implicitly. So when reaching the > first `/` a syntax error is apparent, since there is no way the input can > still form a well-formed statement at that point. > > On 24 May 2017 at 10:32, Peter van der

Re: Arrow function followed by divide or syntax error?

2017-05-24 Thread Peter van der Zee
> Unlike an ordinary function expression, which is a PrimaryExpression, an > arrow function is merely an AssigmentExpression, so has much lower precedence > than any arithmetic operator. I'm curious how this should be parsed so let's break this down. Given the following "Script" (I don't think

Re: Function constants for Identity and No-op

2016-08-10 Thread Peter van der Zee
>> What's the issue with document.createElement('object')? > It's a callable exotic object. >> Function.isFunction? :D > typeof is what you are looking for. There is precedent (at least in IE [1]) for exotic functions where `typeof` returned "unknown". Could happen for any exotic value unless t

Re: ES7 - the standard

2016-06-17 Thread Peter van der Zee
On Thu, Jun 16, 2016 at 11:54 PM, Raul-Sebastian Mihăilă wrote: > I see that es7 is now a standard. > http://www.ecma-international.org/ecma-262/7.0/index.html Nice, thanks for the heads up. Could the spec next time have a non-normative section with the main changes compared to the previous? Som

Pseudo headless arrows

2016-04-21 Thread Peter van der Zee
There are two ways of writing argument-less arrows; () => x; _ => x; (Where `_` can be any identifier, of course.) I understand why we can't drop the head entirely so if we're forced to type anything at all, anyways, why not at least make it simpler by pressing two different keys instead of thr

Re: Swift style syntax

2015-10-12 Thread Peter van der Zee
On Mon, Oct 12, 2015 at 10:12 AM, Mohsen Azimi wrote: >> Your syntax is ambiguous: Should your code be interpreted as: >> >>let passed = objs.filter($0 => $0.passed) >> >> or: >> >>let passed = $0 => objs.filter($0.passed) > > I don't understand why you parsed it in the second way Claude?

Re: please add orEqual operator

2015-08-10 Thread Peter van der Zee
On Mon, Aug 10, 2015 at 3:50 AM, wrote: > Isn't > prop ||= 0; > better than > prop = prop || 0; > and it can be even defined like this. > prop ||= var1 ||= var2 ||= 0; > but then i dont know how we can use it ike this > if (num == 3 ||=4 ||=6) Sounds like you want two operators; `||=` for the co

Re: Named Paramters

2015-07-12 Thread Peter van der Zee
(A minifier that breaks your code is a broken minifier and should never be a valid argument for these cases) On Sun, Jul 12, 2015 at 10:29 AM, Denis Pushkarev wrote: > 1. It would break backwards compatibility: > > ```js > var bar = 1; > if(baz(bar))foo(bar = 5); > console.log(bar); // 5 in some

Re: Reflect.hasOwn() ?

2014-07-27 Thread Peter van der Zee
On Sun, Jul 27, 2014 at 6:14 PM, Mark S. Miller wrote: > Although there is some interesting work in trying to obtain security > relevant guarantees from a script that isn't first, where a malicious script > may instead have been first (link please if anyone has it), this work did > not seem practi

Re: Reflect.hasOwn() ?

2014-07-27 Thread Peter van der Zee
On Sun, Jul 27, 2014 at 1:57 PM, David Bruant wrote: > You can deeply freeze it yourself before any other script accesses it. That's already assuming you are first. You may not be without your knowledge (ISP injection, virus hijack, garden gnomes, etc). At this point you'll be too late. > My poi

Re: Reflect.hasOwn() ?

2014-07-27 Thread Peter van der Zee
On Sat, Jul 26, 2014 at 5:14 PM, Mark S. Miller wrote: > Hi Peter, what is the security issue you are concerned about? Unless `Reflect` is completely sealed out of the box, you can never know whether properties on it are the actual built-ins. That's all. - peter _

Re: Reflect.hasOwn() ?

2014-07-25 Thread Peter van der Zee
On Sat, Jul 26, 2014 at 5:43 AM, Axel Rauschmayer wrote: > The only exception that comes to my mind is `{}.hasOwnProperty.call(obj, > key)` (which is the only safe way to invoke this method). Would it make > sense to provide that as a tool function, e.g. as `Reflect.hasOwn()`? That would make it

Re: Trailing comma for function arguments and call parameters

2014-07-08 Thread Peter van der Zee
On Fri, Jul 4, 2014 at 12:52 AM, Dmitry Soshnikov wrote: > Will it makes sense to standardize a trailing comma for function arguments, > and call parameters? Fwiw, it also makes sense in AMD, where the set of dependencies can grow and the desire to put every module on its own line becomes desirab

Re: BNF grammar in specification license

2014-07-02 Thread Peter van der Zee
Dear Kalinni Gorzkis, I'm curious to what you're hoping to achieve here. This is not your first email to this thread, and by searching on the web, I see you're sending a lot of related messages to various other language groups and what not. This makes me doubt you're actually interested in using t

Re: Multiline Strings

2014-03-07 Thread Peter van der Zee
On Fri, Mar 7, 2014 at 8:56 AM, Florian Bösch wrote: > There's two complications with that. A string doesn't carry the line number > it comes from. Also, myfile.js might get concated with other files. And > lastly strings might get pasted together from smaller snippets. I think you want to take

Re: Array detection (was Re: Final iterator spec)

2014-03-02 Thread Peter van der Zee
> Depends upon what you mean by "Array detection". If you mean is obj an > "exotic array object (ie, an object that automatically updates the length > property value as integer indexed properties are added or deleted) then > Array.isArray(obj) detects exactly that. Okay cool. Is there merit in

Array detection (was Re: Final iterator spec)

2014-03-02 Thread Peter van der Zee
> Peter van der Zee wrote: > >>On Sun, Mar 2, 2014 at 4:18 AM, Domenic Denicola >> wrote: >>> You can just do `if (Symbol.iterator in potentialIterable)`. >> >>Does that work cross-frame? On Sun, Mar 2, 2014 at 5:35 PM, Allen Wirfs-Brock wrote: > Yes O

Re: Re: Final iterator spec

2014-03-02 Thread Peter van der Zee
On Sun, Mar 2, 2014 at 4:18 AM, Domenic Denicola wrote: > You can just do `if (Symbol.iterator in potentialIterable)`. Does that work cross-frame? ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: detecting JS language mode for tools

2014-01-25 Thread Peter van der Zee
`` "It's not a script, it's a module!" On Sat, Jan 25, 2014 at 3:34 PM, David Sheets wrote: > On Sat, Jan 25, 2014 at 2:33 AM, Brendan Eich wrote: >> John Barton wrote: >> >>> On Fri, Jan 24, 2014 at 12:17 PM, Allen Wirfs-Brock >> > wrote: >>> >>> I should have

Re: what kind of problem is this fat arrow feature trying to solve ?

2013-10-02 Thread Peter van der Zee
(In all fairness, Andrea was merely, and quite explicitly so, asking for the rationale behind the fat arrow, not a scrutiny of his examples. Tab's sarcastic response was unnecessary on a whole different level, too.) On Wed, Oct 2, 2013 at 1:14 PM, Benjamin (Inglor) Gruenbaum < ing...@gmail.com> w

Re: Unscopeable

2013-08-21 Thread Peter van der Zee
Can somebody (private mail is okay) please clarify this for me? It looks me like there's a proposal to introduce `@@` syntax to support something that's forbidden in most es6 code anyways (`with`)? Or does it have other use cases? Where can I read more about this? Cheers - peter On Wed, Aug 21,

Re: f() = x de facto standard

2013-08-07 Thread Peter van der Zee
On Wed, Aug 7, 2013 at 6:21 PM, Allen Wirfs-Brock wrote: > I'm not sure where that analysis came from? As far as I know there were no > such changes in ES5.1 and the ES5.1 grammar clearly allows a function call > to appear on the LHS of an assignment. > I got it from https://code.google.com/p/esp

Re: f() = x de facto standard

2013-08-07 Thread Peter van der Zee
To be honest, I was championing that parser writers should write flexible and supportive parsers and put strict ocd parsing under a flag/option. Especially in this case, where you need a parser that should be able to parse content parsable by a number of other parsers (-> browsers), you want your p

Re: Identifying ECMAScript identifiers

2013-03-09 Thread Peter van der Zee
Norbert, for the sake of completeness; ZeParser (http://github.com/qfox/zeparser) does support complete unicode identifiers ZeParser2 (http://github.com/qfox/zeparser2) doesn't (I simply didn't bother) - peter ___ es-discuss mailing list es-discuss@mozi

Array method ranges

2013-01-24 Thread Peter van der Zee
What about adding specific range arguments to the es5 array methods (forEach, map, etc)? Currently the start (inclusive) and stop (exclusive) is always 0 ... length, but what if you only want to map over a sub range of the array? Or maybe I want to traverse the array in reverse? I'd either have to

Re: Reduce context parameter

2013-01-08 Thread Peter van der Zee
On Mon, Jan 7, 2013 at 11:59 PM, Rick Waldron wrote: > The initialVal argument is _optional_ and undefined is valid — how would you > decide if what was passed should be initial value or thisArg? I see. Well, ship has sailed. Thanks. - peter ...(Could have specced the context parameter to be se

Reduce context parameter

2013-01-06 Thread Peter van der Zee
Mostly out of curiosity; why do Array#reduce and reduceRight have no context parameter? - peter ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Arrow functions and return values

2012-11-29 Thread Peter van der Zee
On Thu, Nov 29, 2012 at 10:32 AM, Brendan Eich wrote: > You would need a second ; after b * c; to spell the empty statement. Interesting fact actually, it would mean the empty statement is no longer a NOOP. It can actually alter a program. I can't think of a situation where this is the case in es

Re: "Subclassing" basic types in DOM - best method?

2012-11-20 Thread Peter van der Zee
On Tue, Nov 20, 2012 at 10:31 PM, Rick Waldron wrote: > On Tue, Nov 20, 2012 at 2:45 PM, Tab Atkins Jr. > wrote: >> >> On Mon, Nov 19, 2012 at 9:46 PM, Brendan Eich wrote: >> > Tab Atkins Jr. wrote: >> >> If we did this, the only reason to continue subclassing Map is to get >> >> instanceof chec

Re: let and strict mode

2012-11-15 Thread Peter van der Zee
On Fri, Nov 16, 2012 at 1:35 AM, Allen Wirfs-Brock wrote: > > On Nov 15, 2012, at 4:17 PM, Brendan Eich wrote: > >> Of course, 'let' short for 'letter' :-|. >> >> Contextual keyword with [no LineTerminator here] after sounds like the plan. >> I'm curious whether you have already implemented this

Re: Sandboxing and parsing jQuery in 100ms

2012-11-07 Thread Peter van der Zee
On Thu, Nov 8, 2012 at 12:05 AM, gaz Heyes wrote: > Both your cases are invalid javascript in the browser. So they will never D'oh. I meant escaped parensthesis, didn't think about capturing groups. For the second example, there was supposed to be a space to prevent the line comment. But that do

Re: Sandboxing and parsing jQuery in 100ms

2012-11-07 Thread Peter van der Zee
On Wed, Nov 7, 2012 at 5:53 PM, gaz Heyes wrote: > Hi all > > Check this out: > http://www.thespanner.co.uk/2012/11/07/sandboxing-and-parsing-jquery-in-100ms/ How would you deal with cases like `foo(/)/);` and `foo(5//)/g);` ? So how would you deal with combinations of regular expressions and div

Re: Why are non-method properties in a prototype an anti-pattern?

2012-11-07 Thread Peter van der Zee
On Wed, Nov 7, 2012 at 6:27 PM, Kevin Smith wrote: > This footgun: > > function MyClass() { > > this.value = 1; // OK > this.list.push(0); // Modifying the list for every instance - > probably not intended. > } > > MyClass.prototype.value = 0; > MyClass.prototype.list

Re: thoughts the (re)organization of the specification?

2012-11-04 Thread Peter van der Zee
+1 > stuff ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Convergence options for Ecmascript/Actionscript?

2012-09-02 Thread Peter van der Zee
On Wed, Aug 29, 2012 at 2:30 AM, Brendan Eich wrote: > You really should read back in es-discuss if you have time (understand if > you don't!). We covered what made ES4 fail. The main problem was namespaces, > upon which packages were built. > > Unfortunately, AS3 uses namespaces and packages heav

The Error type

2012-08-16 Thread Peter van der Zee
I was jesting a bit in the other thread (https://mail.mozilla.org/pipermail/es-discuss/2012-August/024602.html) but the more I think about it, the more it makes sense. JS should have an Error primitive type. It would make the "failed" return type for most actions more consistent. The word consisten

Re: Consistency in The Negative Result Values Through Expansion of null's Role

2012-08-16 Thread Peter van der Zee
On Thu, Aug 16, 2012 at 12:02 AM, Erik Reppen wrote: > So for the sake of consistency/sanity in future methods, at least, how about > establishing the following guidelines somewhere on the usage of these > values? > > * More specific negative-result values are reserved for simple statements > and

Re: Spec feedback on rev 6

2012-07-31 Thread Peter van der Zee
On Tue, Jul 31, 2012 at 10:19 PM, Peter van der Zee wrote: > Hi, > > I've read pretty thoroughly through rev 6 of the spec (offline, with a Sorry, I may have been confused. I read the July 8th revision of the draft. Fwiw. ___ es-discuss m

Spec feedback on rev 6

2012-07-31 Thread Peter van der Zee
Hi, I've read pretty thoroughly through rev 6 of the spec (offline, with a pen and a printed spec) and seem to have written down at least something on pretty much every page. It'll take me some time to put it all together digitally, but here are some high level comments (in no particular order):

Re: Default operator strawman - ||| rather than ??

2012-06-12 Thread Peter van der Zee
On Tue, Jun 12, 2012 at 10:56 PM, Tab Atkins Jr. wrote: > "undefined" is special-cased here because it's an extremely common > value to check against.  It's used when an argument isn't supplied, or > when you try to pull a non-existent property off of an object. I believe the most common case for

Re: Default operator strawman - ||| rather than ??

2012-06-12 Thread Peter van der Zee
> If the above is "this, absolutely" and such a feature, I favor this as Wow, something messed up big time. "If the above answer is "this, absolute" and such a feature is seriously considered ..." ___ es-discuss mailing list es-discuss@mozilla.org https

Re: Default operator strawman - ||| rather than ??

2012-06-12 Thread Peter van der Zee
On Tue, Jun 12, 2012 at 5:29 PM, T.J. Crowder wrote: > In the current default operator strawman[1], the operator is ??, e.g.: > > a = b ?? 5; > > is shorthand for > > a = b !== undefined ? b : 5; I missed this discussion. What validates the introduction of this syntax over the equally simple and

Re: catch vs function scope; var declaration vs initialization

2012-05-14 Thread Peter van der Zee
On Mon, May 14, 2012 at 11:57 AM, Claus Reinke wrote: > What should be the output of the following code? > > (function(){ > > try { >  throw "hi"; > } catch (e) { >  var e = "ho"; >  var o = "hu"; >  var u; >  console.log(e); > } > console.log(e,u,o); > > }()); > > It seems clear that the first co

Re: Even simpler lambdas

2012-04-17 Thread Peter van der Zee
On Tue, Apr 17, 2012 at 10:11 PM, Brendan Eich wrote: > ... That's a readability problem > that I suspect would sink this if it were to get to TC39. On the subject of readability; I believe that a worded keyword; map(return $1+$2) gives a much stronger emphasis to "HEY, I'M DOING FUNCTION STUFF O

Re: Even simpler lambdas

2012-04-17 Thread Peter van der Zee
On Tue, Apr 17, 2012 at 10:11 PM, Brendan Eich wrote: > François REMY wrote: >> >> I kinda like it. > > > I don't, but what's more, Tab's point has come up already in TC39 in similar > settings. I doubt this will fly. It's hard to see 'return' in an expression > as different from 'return' at state

Even simpler lambdas

2012-04-17 Thread Peter van der Zee
Why can't lambda's be a simple case of a lexically scoped `return` keyword with any arguments implicitly defined and accessible through a predefined identifier/keyword (much like `arguments` works now)? arr.map(return '<'+arguments[0]+' class="'+this.getClassName(arguments[1])+'"/>'); arr.map(ret

Re: undefined being treated as a missing optional argument

2012-04-13 Thread Peter van der Zee
On Fri, Apr 13, 2012 at 5:19 PM, Erik Arvidsson wrote: > If you really need to know how many arguments were passed just use rest > parameters. > > We should definitely not add more API to the arguments object. I retract my suggestion. Russell was right. - peter __

Re: undefined being treated as a missing optional argument

2012-04-13 Thread Peter van der Zee
Fwiw, arguments.length is currently the _only_ way of properly detecting the correct number of explicit variables of _any_ type. I would hate for that behavior to change in the case of explicitly passing on undefined. Default values of course do need to be set in the arguments array so it's length

Re: Fun impossible Firefox JS challenge

2012-04-12 Thread Peter van der Zee
On Thu, Apr 12, 2012 at 6:13 PM, Allen Wirfs-Brock wrote: > At this point I think we need to do two things: Add a third to that, because I don't think Gaz was talking about unicode escapes ("Haha nice try"). I'm still curious to the answer :) - peter _

Re: Fun impossible Firefox JS challenge

2012-04-12 Thread Peter van der Zee
On Thu, Apr 12, 2012 at 4:12 PM, Andreas Rossberg wrote: >> Haha nice try even with unicode escapes it still refers to "true" the >> boolean not the function. > > That's another FF deviation from the standard, though. Identifiers with unicode escapes have the meaning of their canonical value. So

Re: Terminology: “non-method function”

2012-04-11 Thread Peter van der Zee
On Wed, Apr 11, 2012 at 1:01 AM, Axel Rauschmayer wrote: > What is a good term for functions that don’t have/use dynamic `this`? A bound function? ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Should ... be suffix rather than prefix?

2012-04-03 Thread Peter van der Zee
Second... On Tue, Apr 3, 2012 at 10:16 PM, Mark S. Miller wrote: >     foo(a, b, ...rest) > > vs > >     foo(a, b, rest...) > > Which is clearer? > > ES6 has currently agreed on the first. English and Scheme agree on the > second. > > This question applies to both >

Array#sort(prop)

2012-04-01 Thread Peter van der Zee
No idea whether this has been discussed before, but I find myself continuously doing this when sorting arrays with objects: arr.sort(function(a,b){ if (a.prop < b.prop) return -1; if (a.prop > b.prop) return 1; return 0; }); Couldn't we add an optional string argument to Array#sort that does this

Re: simpler, sweeter syntax for modules

2012-03-22 Thread Peter van der Zee
On Wed, Mar 21, 2012 at 11:28 PM, David Herman wrote: > * importing with renaming: > >    import { draw: drawGun }    from "cowboy.js", >           { draw: drawWidget } from "widgets.js"; > The brackets don't seem necessary (at least not from a parsing perspective). Maybe drop them? import draw:

Re: YAWSI: an identity unary operator

2012-03-19 Thread Peter van der Zee
As long as we're bikeshedding; none of your examples look as clean to me as the original. If you're dead set on fixing this, try changing the this keyword... var a; var obj = { get a() {return a}, set a(v) {a=v} }; var obj = { a: null, get a() {return this.a}, set a(v) {this.a=v} }; Th

Re: Math.clz()

2012-03-04 Thread Peter van der Zee
Maybe make it generic? Although that might not be very important for the case of counting leading zeroes or ones. I'd love a function for getting n consecutive bits (to left or right..) from number x starting from the nth bith (from the left or right) as a single number as if the lsb was 1. You ca

Re: New full Unicode for ES6 idea

2012-02-19 Thread Peter van der Zee
Do we know how many scripts actually rely on \u15 to produce a stringth length of 3? Might it make more sense to put the new unicode escape under a different escape? Something like \e for "extended unicode" for example. Or is this "acceptable migration tax"... On a side note, if we're going to

Re: Fallback

2012-02-10 Thread Peter van der Zee
elimiter, regardless. - peter > > -----Message d'origine- From: Peter van der Zee > Sent: Friday, February 10, 2012 11:27 AM > To: es-discuss > Subject: Fallback > > > There's currently no way of introducing anything new into the language > that breaks syntax. I thi

Fallback

2012-02-10 Thread Peter van der Zee
There's currently no way of introducing anything new into the language that breaks syntax. I think that point has been made very clearly with harmony/es6. Can we introduce a way to make these transitions easier in the future? CSS has a very simple way of gracefully ignore rules it doesn't know. In

Re: Deep cloning objects defined by JSON.

2012-01-29 Thread Peter van der Zee
On Sun, Jan 29, 2012 at 10:09 PM, Xavier MONTILLET wrote: > I think it should keep it. Douglas did something to allow cyclic > references ( https://github.com/douglascrockford/JSON-js/blob/master/cycle.js > ) and he probably wouldn't have done that if it had no use. Plus > you're talking of clonin

Re: Deep cloning objects defined by JSON.

2012-01-29 Thread Peter van der Zee
On Sun, Jan 29, 2012 at 7:50 PM, Xavier MONTILLET wrote: > With your last two implementations, you don't keep cyclic references. I did not intend to. In fact, my intention was to have a "clean" object with just structure (objects and arrays) and primitives. Nothing else, especially nothing invisi

Re: Deep cloning objects defined by JSON.

2012-01-29 Thread Peter van der Zee
On Sun, Jan 29, 2012 at 7:23 PM, David Bruant wrote: > Based on your description, it seems that the definition would be: > > JSON.clone = function(o){ >  return JSON.parse(JSON.stringify(o)); > } Yes. You can debate whether it should remove properties it can't serialize completely, or define them

Re: Deep cloning objects defined by JSON.

2012-01-29 Thread Peter van der Zee
Why can't we define a JSON.clone() or .deepClone() which would only clone properties that are primitives, object or array. If they are (instanceof) array, copy index properties and length value and create new array with that information. If object, create new object and copy all properties with the

Versioning?

2011-12-19 Thread Peter van der Zee
https://lists.webkit.org/pipermail/webkit-dev/2011-December/018924.html ``use version 6;`` In which thread on esdiscuss should I have read about that? - peter ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discu

Re: Nov 16 meeting notes

2011-11-18 Thread Peter van der Zee
On Thu, Nov 17, 2011 at 10:02 PM, Brendan Eich wrote: > On Nov 17, 2011, at 11:26 AM, Dean Landolt wrote: > >> Who can resist such a juicy bikeshed... Please keep the general js api consistent. We don't use "count" for anything to consider "the number of elements in the structure" (actually, we d

Re: with

2011-11-17 Thread Peter van der Zee
On Thu, Nov 17, 2011 at 12:53 PM, Dmitry Soshnikov wrote: >> My first answer was glib, sorry. I'm proposing `with' as a replacement >> syntax for <|. So the above expression evaluates to the same as > Once again, it's absolutely the same approach which I showed yesterday with > using `exten

Re: making |this| an error (was Re: for own(...) loop)

2011-11-09 Thread Peter van der Zee
The forEach method might not do what you expect it to. This can not be statically determined. - peter On 9 Nov 2011 16:10, "John J Barton" wrote: > On Wed, Nov 9, 2011 at 3:41 AM, David Bruant wrote: > > Le 09/11/2011 02:26, Andrew Paprocki a écrit : > >> > >> On Tue, Nov 8, 2011 at 6:36 PM, Br

Re: Loyal Opposition to Const, Private, Freeze, Non-Configurable, Non-Writable...

2011-11-02 Thread Peter van der Zee
On Wed, Nov 2, 2011 at 5:44 PM, David Bruant wrote: > I agree that the second argument is a design mistake. But ES6 will fix > this with the proto operator. "fix" It has the same kind of baggage and goes into the "minor features" category, at least in terms of syntax, in my opinion. - peter ___

Re: Another paren-free gotcha

2011-09-29 Thread Peter van der Zee
On Thu, Sep 29, 2011 at 3:43 AM, Quildreen Motta wrote: > I'm not sure how this is much different from the rules you have now with > ASI, though if this were such a problem, a block statement could be required I'm trying to make sure we don't add another feature that we'll later describe as "yeah

Re: Another paren-free gotcha

2011-09-28 Thread Peter van der Zee
On Thu, Sep 29, 2011 at 12:38 AM, Douglas Crockford wrote: > On 11:59 AM, Waldemar Horwat wrote: >> >> Thinking about the implications of paren-free, I see additional potential >> trouble spots in addition to the one I mentioned in the meeting yesterday: These kind of potential confusions raise a

Re: IDE support?

2011-09-13 Thread Peter van der Zee
>> I'm assuming that conclusion already because the current tools for JS >> development are so incredibly lame that wasting time on static >> analysis -- which we know does not work without changing the language > > Ok, your assumed conclusion rests on a prior assumption: > >> static analysis ... w

Re: IDE support?

2011-09-12 Thread Peter van der Zee
> There are some half dozen or more papers on Javascript type inference > or static analysis (hmm, is there a central wiki or bibliography where > we could record and collect such JS-related references? should I post > here what I've found so far?). For as far as you haven't already, I'd love to s

Re: IDE support?

2011-09-12 Thread Peter van der Zee
On Mon, Sep 12, 2011 at 1:04 AM, Brendan Eich wrote: > Type Inference can do a lot. See http://doctorjs.org/. > > We do not want people adding guards all over their code, IMHO. Anyway, we > don't know have guards ES6. While true, I've found that you can't really overcome the dynamic property acc

Re: __doc__ for functions, classes, objects etc.

2011-08-21 Thread Peter van der Zee
On Sun, Aug 7, 2011 at 6:56 PM, Dmitry A. Soshnikov wrote: > Hi, > > What about to standardize (Python's) "__doc__"-umentation comments for JS? What's the difference between that and the /** ... */ way of "JSDoc"? /** * This function does stuff * @constructor * @param {Object} foo * @returns

Re: \u0085 whitespace or a random unicode character by ES5?

2011-07-06 Thread Peter van der Zee
On Wed, Jul 6, 2011 at 7:38 PM, Dave Fugate wrote: > Several test262 test cases operate on the assumption ‘\u0085’, aka Next > Line, is considered a whitespace character and I’d like to get some > clarification on whether it really is or not as-per ES5.1. > > Table 3 of ES5, Line Terminator Charac

Re: Regex on substrings

2011-06-02 Thread Peter van der Zee
On Thu, Jun 2, 2011 at 7:17 PM, Mike Samuel wrote: > 2011/6/2 Peter van der Zee : >> A problem I faced recently is the inability to apply regular >> expressions to a substring of a string without explicitly taking the >> substring first. So I'm wondering how much troubl

Regex on substrings

2011-06-02 Thread Peter van der Zee
A problem I faced recently is the inability to apply regular expressions to a substring of a string without explicitly taking the substring first. So I'm wondering how much trouble it would be to extend the RegExp api to this... RegExp.prototype.test = function(string[, start=0[, stop=string.lengt

Re: Automatic Semicolon Insertion: value vs cost; predictability andcontrol; alternatives

2011-04-18 Thread Peter van der Zee
On Mon, Apr 18, 2011 at 12:34 PM, Jorge wrote: > What am I missing ? > As far as the directive goes, they are opt-in. Old code won't be opting in. Other than that they have the same issues as "use strict" might have. - peter ___ es-discuss mailing lis

Re: Automatic Semicolon Insertion: value vs cost; predictability andcontrol; alternatives

2011-04-18 Thread Peter van der Zee
On Mon, Apr 18, 2011 at 3:12 AM, Oliver Hunt wrote: > An implementation _could_ add a mode (*shudder*) along the same lines as > strict mode: > "die in hell ASI, i hate you with the fiery passion of a thousand burning > suns."; > > And then make it a syntax error whenever ASI would occur. I have

Removing labels

2011-04-09 Thread Peter van der Zee
Can we remove labels from the next version of the spec? Labels are only used for continue and break. I don't think I've ever had or seen a need for them (which does not mean they're unused, btw). They can be sugar insofar as to breaking a double loop at once. But at the same time they promote spag

Re: Inner functions and outer 'this' (Re: That hash symbol)

2011-03-29 Thread Peter van der Zee
On Tue, Mar 29, 2011 at 4:16 AM, Erik Arvidsson wrote: > We (Chromium/V8) discussed introducing 'self' as a a way to get the > lexically bound 'this'. The main issue we could think of was that it > might be hard for users to know when to use '^this' vs when to use > 'this'. > `self` will almost d

Re: String.prototype.repeat

2011-03-22 Thread Peter van der Zee
On Tue, Mar 22, 2011 at 2:39 AM, Dmitry A. Soshnikov < dmitry.soshni...@gmail.com> wrote: > On 22.03.2011 23:42, David Bruant wrote: > > Hi, > > About the string_repeat strawman ( > http://wiki.ecmascript.org/doku.php?id=strawman:string_repeat), one > alternative solution could be a two argument

Re: Date vs Daylight Savings

2011-03-21 Thread Peter van der Zee
On Mon, Mar 21, 2011 at 6:54 PM, Peter van der Zee wrote: > On Fri, Mar 11, 2011 at 12:12 AM, Luke Smith wrote: > >> The consistent behavior across all browsers of Date when passed a time >> made invalid by a DST jump is to roll the time *back* by an hour. >> // On

Re: Date vs Daylight Savings

2011-03-21 Thread Peter van der Zee
On Fri, Mar 11, 2011 at 12:12 AM, Luke Smith wrote: > The consistent behavior across all browsers of Date when passed a time made > invalid by a DST jump is to roll the time *back* by an hour. > // On a system with Pacific TZ > new Date(2011, 2, 13, 2, 0, 0, 0); > Sun Mar 13 2011 01:00:00 GMT-080

Re: Bringing setTimeout to ECMAScript

2011-03-19 Thread Peter van der Zee
On Sat, Mar 19, 2011 at 2:49 PM, Breton Slivka wrote: > never write code on no sleep. > > that code sample should be : > > timers= (function () { > var timers = []; > var id=0; > timer=function (f,t) { > timers.push({func:f, interval:t, id:id++}); > return id; >

Re: Bringing setTimeout to ECMAScript

2011-03-19 Thread Peter van der Zee
On 19 Mar 2011 14:43, "Breton Slivka" wrote: > > > I can't think of a single way to simulate setTimeout in ES5. Correct me if > > I'm wrong, but I don't think ES5 exposes a single way of defining a > > mechanism like: > > -- > > var x = 4; > > function f(){ x = 5; print(x); } > > timer(f, 1); > >

Re: Bringing setTimeout to ECMAScript

2011-03-19 Thread Peter van der Zee
On Sat, Mar 19, 2011 at 1:13 AM, Brendan Eich wrote: > On Mar 18, 2011, at 5:54 AM, Peter van der Zee wrote: > > +1 to standardizing the timer family. > > I always thought this wasn't in because the specification didn't have > any asynchronism and specifying tim

Re: Bringing setTimeout to ECMAScript

2011-03-18 Thread Peter van der Zee
+1 to standardizing the timer family. I always thought this wasn't in because the specification didn't have any asynchronism and specifying timers would open Pandora's box. - peter On Fri, Mar 18, 2011 at 1:51 PM, David Bruant wrote: > Hi, > > _Foreword_ > Each time I write "setTimeout", I mea

Re: do-while grammar

2011-02-09 Thread Peter van der Zee
Fwiw I don't recall any specific cases of input accepted by browsers which shouldn't parse according to the spec, other than functions in statements. Even "callable regular expressions" are fine as far as the grammar goes. I don't have an extensive test suite for regular expressions or strict mode

Re: Operator Overloading

2011-01-13 Thread Peter van der Zee
Rather than overloading existing operators, might it be an idea to introduce a new generic "programmable" operator? It's just a thought. In all fairness it doesn't feel quite like js to me, but the desire to handle/define operators seems to be present. Maybe the @ sign would be fitting for this. It

Re: New private names proposal

2010-12-22 Thread Peter van der Zee
> On Dec 22, 2010, at 7:10 AM, Peter van der Zee wrote: > >> What about adding an attribute to properties that somehow >> identify which classes (in the prototype chain for protected) >> have access to the object? I'll leave the "somehow" up in the >

Re: New private names proposal

2010-12-22 Thread Peter van der Zee
On Wed, Dec 22, 2010 at 3:26 PM, David Herman wrote: > > As for the complaint of it being over-generative, that's mitigated in this > case by the sigil. For example, if you wrote: > > function Point(x, y) { > private #x, #y; > this.#x = x; > this.#y = y; > } >

Re: es5 bug, operator == and valueOf

2010-12-01 Thread Peter van der Zee
Has an operator like >== ever been proposed? So the "strict" relational operator that returns NaN if typeof left and right don't match. If so, why was it shot down? Bloat? Relatively useless? - peter On Wed, Dec 1, 2010 at 1:45 AM, Brendan Eich wrote: > On Nov 30, 2010, at 3:25 PM, Fyodorov Bga

Re: Guards are now ready for discussion (was: Nov 18 notes)

2010-11-22 Thread Peter van der Zee
On Mon, Nov 22, 2010 at 9:43 AM, Brendan Eich wrote: > On Nov 22, 2010, at 12:37 AM, Peter van der Zee wrote: > > On Mon, Nov 22, 2010 at 6:54 AM, Brendan Eich wrote: > >> >> The ML-ish solution, which is forward compatible, is to parenthesize: >> >> le

Re: Nov 18 notes

2010-11-22 Thread Peter van der Zee
On Mon, Nov 22, 2010 at 8:37 AM, David Herman wrote: > > for (var i : x) ... // must be new iteration > > for (var i : T : x) ... // iteration again, but parsed how? > > for (var i : T in x) ... // for-in with annotated var > > Bummer! > > I'm beginning to feel more strongly again that over

Re: Guards are now ready for discussion (was: Nov 18 notes)

2010-11-22 Thread Peter van der Zee
On Mon, Nov 22, 2010 at 6:54 AM, Brendan Eich wrote: > > The ML-ish solution, which is forward compatible, is to parenthesize: > > let typedObj = { (prop1:type1): value1, (prop2:type2): value2, ... }; > > The parentheses hurt too, but only this case. And it still may win to > annotate the entire

  1   2   >