WeakMap not the weak needed for zombie views

2014-07-05 Thread Peter Michaux
Hi, I've been reading about WeakMap in the draft. To my surprise, it is not at all what I thought it would be or what I was hoping to use. At least that is my understanding. My use case is in MV* architectures. With current MV* frameworks, a model holds strong references to the views observing

Re: Set Objects

2013-04-03 Thread Peter Michaux
On Fri, Mar 29, 2013 at 5:04 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Mar 29, 2013, at 3:02 PM, Peter Michaux wrote: 15.16.4.6 Why will callbackfn be called with the first two parameters being the same? That does not seem like the most practical or intuitive behavior

Re: Set some, every, reduce, filter, map methods

2013-03-30 Thread Peter Michaux
reduceRight as well, even if it would only do the same as reduce. Peter Michaux wrote: In another thread, I'm told there is currently no plans to add the following to Set.prototype. some every reduce filter map These seem like very natural additions and the type of operations that one would

Set Objects

2013-03-29 Thread Peter Michaux
Some comments and questions about the Set draft specification... - - - Section 15.16 begins with the following which seems to need an English clean-up. Set objects are collections of ECMAScript language values. A distinct value may only occur once as elements of a Set’s collection. Distinct

Re: Add intersections and unions to Set

2013-03-29 Thread Peter Michaux
On Mon, Mar 4, 2013 at 10:56 AM, Tab Atkins Jr. jackalm...@gmail.com wrote: On Mon, Mar 4, 2013 at 10:08 AM, al...@instantbird.org wrote: It would be useful to be able to form the intersection and the union of two Sets. These are natural operations that are currently not part of the API

Set some, every, reduce, filter, map methods

2013-03-29 Thread Peter Michaux
In another thread, I'm told there is currently no plans to add the following to Set.prototype. some every reduce filter map These seem like very natural additions and the type of operations that one would want to do on sets. Peter ___ es-discuss

Re: Weak event listener

2013-03-25 Thread Peter Michaux
On Mon, Mar 25, 2013 at 2:55 AM, Marius Gundersen gunder...@gmail.com wrote: One thing which is impossible to make in JavaScript today is a weakly referenced event listener system. In such a system an event listener is not strongly referenced by the event system, so events are only dispatched

Re: Set length property

2012-03-30 Thread Peter Michaux
to collaborate on this and will present it at the May meeting. So no, not yet. As always, suggestions welcome. On Thu, Mar 29, 2012 at 10:22 PM, Peter Michaux petermich...@gmail.com wrote: On Sun, Feb 12, 2012 at 7:08 PM, Brendan Eich bren...@mozilla.org wrote: The January 19 2012 meeting

Re: Set polyfill with a has method more efficient than O(n)

2012-03-30 Thread Peter Michaux
On Thu, Mar 29, 2012 at 10:20 PM, Brendan Eich bren...@mozilla.org wrote: Peter Michaux wrote: I've worked on a generic Set polyfill. It is quite a simple task to build one but determining if an object is in the set is O(n) with the following has method.     Set.prototype.has = function

Re: Set polyfill with a has method more efficient than O(n)

2012-03-30 Thread Peter Michaux
On Fri, Mar 30, 2012 at 12:44 AM, David Bruant bruan...@gmail.com wrote: One idea would be that each Set puts a unique marker on each object it contains I thought about an approach like this but am looking to avoid mutating the elements in the set. Thanks though. Peter

Set polyfill with a has method more efficient than O(n)

2012-03-29 Thread Peter Michaux
I've worked on a generic Set polyfill. It is quite a simple task to build one but determining if an object is in the set is O(n) with the following has method. Set.prototype.has = function(element) { for (var i = 0, ilen = this._elements.length; i ilen; i++) { if (element

Re: Set length property

2012-03-29 Thread Peter Michaux
On Sun, Feb 12, 2012 at 7:08 PM, Brendan Eich bren...@mozilla.org wrote: The January 19 2012 meeting notes recorded here: https://mail.mozilla.org/pipermail/es-discuss/2012-January/019784.html include At next meeting MarkM will present a tiny API proposal for maps and sets. Has this

Re: Second arguments for Array.prototype.sort: map function

2012-02-23 Thread Peter Michaux
On Mon, Feb 20, 2012 at 11:52 AM, Xavier MONTILLET xavierm02@gmail.com wrote: what I would like is to be able to do this: var sortedArray = array.sort( compare, f ); I think the above is not very readable. The following is more readable and shows the order in which the more modular parts

Re: Array.prototype.contains

2012-02-23 Thread Peter Michaux
On Thu, Feb 23, 2012 at 12:35 PM, Mark S. Miller erig...@google.com wrote:     if (arr.contains(foo)) { vs     if (arr.indexOf(foo) !== -1) { The readability of the above two options is very different. The first option is far superior as it expresses what the programmer wants to know. The

Re: Second arguments for Array.prototype.sort: map function

2012-02-23 Thread Peter Michaux
I think I misunderstood your intent. Is what you want equivalent to the following? arr.map(function(el){return {a:el,b:f(el)};}).sort(function(x, y) {return x.b y.b;}).map(function(el){return el.a;}); Peter On Thu, Feb 23, 2012 at 6:12 PM, Peter Michaux petermich...@gmail.com wrote: On Mon

Re: Array.prototype.contains

2012-02-23 Thread Peter Michaux
? 0 : 1; }) When sorting a valid packed array of valid IEEE floating point values, you take your life in your hands. /only a bit tongue in cheek On Thu, Feb 23, 2012 at 6:18 PM, Peter Michaux petermich...@gmail.com wrote: On Thu, Feb 23, 2012 at 12:35 PM, Mark S. Miller erig...@google.com

set.reset method

2012-02-15 Thread Peter Michaux
I don't know how rich the committee wants to make objects in ES.next. For example, what about a set.reset method? Set.prototype.reset = function() { this.empty(); for (var i = 0, ilen = arguments.length; i ilen; i++) { } } ___ es-discuss

Re: set.reset method

2012-02-15 Thread Peter Michaux
Sorry. Incomplete message before and premature send. Set.prototype.reset = function() { this.empty(); for (var i = 0, ilen = arguments.length; i ilen; i++) { this.add(arguments[i]); } }; Peter On Wed, Feb 15, 2012 at 10:39 PM, Peter Michaux petermich...@gmail.com wrote: I

set.add and set.delete arguments

2012-02-15 Thread Peter Michaux
Can set.add and set.delete take multiple arguments? This would go nicely with the spread of operation on an iterate that was discussed for multiple arguments to the Set constructor. var set0 = new Set('alpha', 'beta'); set0.add('gamma', 'delta'); var set1 = new Set('epsilon', 'zeta');

Re: set.add and set.delete arguments

2012-02-15 Thread Peter Michaux
If add and delete take multiple arguments, the return value could be changed from a boolean to the number of elements added or deleted, or to the set of elements added or deleted? Peter On Wed, Feb 15, 2012 at 10:54 PM, Peter Michaux petermich...@gmail.com wrote: Can set.add and set.delete take

Re: Set constructor arguments

2012-02-14 Thread Peter Michaux
On Tue, Feb 14, 2012 at 12:09 AM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: thinking about the add behavior, where no duplicated values will be added, this argument may cause some logic headache anyway Set([1, 2, 1]) what should happen ? I think that should be a set with one

set.empty() method

2012-02-14 Thread Peter Michaux
If some piece of code needs to empty a set, it would be good to do that in a single call set.empty(); Otherwise we might be left doing the following which could be very inefficient. set.forEach(function(element) { set['delete'](element); }); Peter

Re: Set iterators

2012-02-13 Thread Peter Michaux
as a possible. The idea behind any Set (outside of ES even) is that it is just a collection of elements, unordered. On Mon, Feb 13, 2012 at 19:32, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Feb 12, 2012, at 4:52 PM, Peter Michaux wrote: In the proposal, iterators for Set are listed

set.add and set.delete return values

2012-02-13 Thread Peter Michaux
The return value set.delete tells the caller if the set was modified or not. It would be useful if the return value of set.add did the same. For example, this way a model in MVC could efficiently know if and notify observers that a real change to the set actually happened.

Re: set.delete method name

2012-02-12 Thread Peter Michaux
) be supported only as the target of an ES5/6 - ES3 translation. Granted this will take years. But we'll be living with these choices for many more years after that. On Sat, Feb 11, 2012 at 11:11 PM, Peter Michaux petermich...@gmail.com mailto:petermich...@gmail.com wrote:    The Set proposal has

Set length property

2012-02-12 Thread Peter Michaux
In the proposal, set objects have no length property. It is common to want to know the length of a set. http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets For example, it would be good to be able to do the following. var s = new Set(); s.add('alpha'); s.add('beta'); s.length;

Set iterators

2012-02-12 Thread Peter Michaux
In the proposal, iterators for Set are listed as todo. If engine implementers have decided to start moving forward implementing Sets, then it would be great if they could get iteration going sooner than later. http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets Looking at the

set.delete method name

2012-02-11 Thread Peter Michaux
The Set proposal has a delete method. Old ECMAScript implementations do not allow delete to appear as a bare method name like set.delete('foo') and it is necessary to write the awkward set['delete']('foo'). Because of this and knowing polyfills will be written to support Set in older

Re: prototype focus

2011-06-30 Thread Peter Michaux
/prototypes-as-classes.html#3 [1] http://stackoverflow.com/questions/54867/old-style-and-new-style-classes-in-python Axel On Jul 1, 2011, at 1:07 , es-discuss-requ...@mozilla.org wrote: From: Peter Michaux petermich...@gmail.com Date: June 30, 2011 21:54:47 GMT+02:00 To: es-discuss es-discuss

Re: minimal classes

2011-06-27 Thread Peter Michaux
On Mon, Jun 27, 2011 at 10:13 PM, Brendan Eich bren...@mozilla.com wrote: On Jun 27, 2011, at 10:00 PM, David Herman wrote: I've been concerned about the schedule risk of classes for ES.next Is the timeline posted somewhere? - providing idiomatic syntax for calling the superclass

Re: Making super work outside a literal?

2011-06-22 Thread Peter Michaux
On Wed, Jun 22, 2011 at 8:28 AM, Sean Eagan seaneag...@gmail.com wrote: On Wed, Jun 22, 2011 at 10:01 AM, Brendan Eich bren...@mozilla.com wrote: On Jun 22, 2011, at 6:48 AM, Sean Eagan wrote: I don't think we need any safety check when assigning a method or accessor getter or setter that

Re: es-discuss Digest, Vol 52, Issue 117

2011-06-20 Thread Peter Michaux
On Mon, Jun 20, 2011 at 1:27 PM, Axel Rauschmayer a...@rauschma.de wrote: Terminology (created by me, but I think it explains well what is going on): - |this| points to the object where property lookup starts. It always points to the beginning of the prototype chain. - |here| points to the

Re: Making super work outside a literal?

2011-06-20 Thread Peter Michaux
On Mon, Jun 20, 2011 at 3:23 PM, Axel Rauschmayer a...@rauschma.de wrote: What is the use case for sideways calls? Can you point me to an example? You want to allow the API (a.k.a. public methods) of an object to be overridden, but you don't want the functionality of any non-overidden API

Re: Making super work outside a literal?

2011-06-19 Thread Peter Michaux
Alpha.one b.two(); // Alpha.one Beta.one Beta.one g.two(); // Alpha.one Beta.one Gamma.one g.three(); // Beta.one Gamma.one Gamma.one Peter On Jun 19, 2011, at 19:44 , Peter Michaux wrote: On Sun, Jun 19, 2011 at 10:20 AM, Axel Rauschmayer a...@rauschma.de wrote: It would be nice if super could

Re: Prototypes as the new class declaration

2011-06-18 Thread Peter Michaux
On Tue, Jun 14, 2011 at 10:08 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: The correspondence is even closer if we slightly extend the new operator. Using current new operator semantics and my alternative way of defining SkinnedMeesh and then executing: let aSM = new

block lambda proposal in light of compiling to JavaScript

2011-06-18 Thread Peter Michaux
Recently, I've invested time looking at current compiling-to-JavaScript developments. Although people have been doing this for many years now, it seems CoffeeScript is making it clear that being a target of compilation is at least part of JavaScript's future. The pending additions in browsers of

Re: block lambda proposal in light of compiling to JavaScript

2011-06-18 Thread Peter Michaux
On Sat, Jun 18, 2011 at 11:53 AM, Brendan Eich bren...@mozilla.com wrote: On Jun 18, 2011, at 10:33 AM, Peter Michaux wrote: Yet CoffeeScript does not need lambdas with TCP control effects today. It translates in a straightforward (mostly) transpiling way. Even its expression-language mapping

Re: Classes: suggestions for improvement

2011-06-13 Thread Peter Michaux
On Mon, Jun 13, 2011 at 12:31 PM, Brendan Eich bren...@mozilla.com wrote: The language to emulate is Smalltalk, though. +1 to that; however, the ES class proposal is not very similar to Smalltalk classes. Others are far more qualified to enumerate the differences than I am. For example, how

super, self, and sideways durable vs. template

2011-06-12 Thread Peter Michaux
Something I try to do when designing constructors is to ensure the constructed objects will be durable. That is, if some code modifies or breaks parts of the constructed object's exposed interface, the other parts of the exposed interface should continue working the same as before. Part of what I

class sugar: static inheritance

2011-06-05 Thread Peter Michaux
Are static members inherited? What happens in the last line of the following code? class Monster { static allMonsters = []; constructor() { Monster.allMonsters.push(this); } } class Dragon extends Monster { constructor() {} } new

Re: block lambda revival

2011-06-04 Thread Peter Michaux
On Fri, May 20, 2011 at 5:54 PM, Brendan Eich bren...@mozilla.com wrote: As promised/threatened: http://wiki.ecmascript.org/doku.php?id=strawman:block_lambda_revival The examples on the wiki page feature calling a function that takes one block argument and also feature Tennent's correspondence

Re: Different semantics should have different-looking syntax

2011-06-04 Thread Peter Michaux
On Sat, May 21, 2011 at 12:37 PM, Brendan Eich bren...@mozilla.com wrote: For http://wiki.ecmascript.org/doku.php?id=strawman:block_lambda_revival I have written up the Ruby-inspired {|x| x * x} syntax. Alternatives (ignoring keyword issues) that look more like function syntax (Peter's

Re: block lambda revival, now with semantics

2011-06-04 Thread Peter Michaux
On Sun, May 22, 2011 at 9:17 PM, Brendan Eich bren...@mozilla.com wrote: http://wiki.ecmascript.org/doku.php?id=strawman:block_lambda_revival Suppose we have a host API to open and close files and we write the following two functions. var withFile = function(filename, fn) { var file

PTC and SHOULD vs MUST

2011-06-01 Thread Peter Michaux
http://wiki.ecmascript.org/doku.php?id=harmony:proper_tail_calls I notice that in the proper tail calls wiki page that a compliant interpreter SHOULD implement a call in proper tail position as a PTC. In order for a programmer to use proper tail calls for arbitrarily deep recursion, the

Re: May 24-26 rough meeting notes

2011-05-28 Thread Peter Michaux
On Thu, May 26, 2011 at 4:22 PM, Waldemar walde...@google.com wrote: Versioning: script type=application/ecmascript;version=6 (RFC 4329) use version 6; module LOL { ... } /script There are good reasons to have the metadata both externally (in the script tag) and internally (in the

Re: Guards

2011-05-27 Thread Peter Michaux
On Fri, May 27, 2011 at 1:44 AM, Brendan Eich bren...@mozilla.com wrote: On May 26, 2011, at 9:36 PM, Peter Michaux wrote: I'm looking at the strawman for guards. http://wiki.ecmascript.org/doku.php?id=strawman:guards I don't quite see how they are created. I understand this part

Re: Guards

2011-05-27 Thread Peter Michaux
On Fri, May 27, 2011 at 12:55 PM, Sam Tobin-Hochstadt sa...@ccs.neu.edu wrote: On Fri, May 27, 2011 at 1:59 PM, Peter Michaux petermich...@gmail.com wrote: A minifier could, couldn't it? function foo(a::MyType) {} would be minified to function foo(a) {} These are not the same function

Re: Guards

2011-05-27 Thread Peter Michaux
On Fri, May 27, 2011 at 1:24 PM, Sam Tobin-Hochstadt sa...@ccs.neu.edu wrote: On Fri, May 27, 2011 at 4:03 PM, Peter Michaux petermich...@gmail.com wrote: On Fri, May 27, 2011 at 12:55 PM, Sam Tobin-Hochstadt sa...@ccs.neu.edu wrote: On Fri, May 27, 2011 at 1:59 PM, Peter Michaux petermich

Guards

2011-05-26 Thread Peter Michaux
From: Waldemar walde...@google.com Date: Thu, May 26, 2011 at 4:22 PM Subject: May 24-26 rough meeting notes Guard Syntax: Technical aspects ok, but some are worried about the effects of this change on the ECMAScript style. What aspects of ECMAScript style were cause for concern? Fear of

Re: block lambda revival

2011-05-21 Thread Peter Michaux
On Sat, May 21, 2011 at 7:43 AM, Brendan Eich bren...@mozilla.com wrote: On May 20, 2011, at 9:55 PM, Peter Michaux wrote: On Fri, May 20, 2011 at 5:54 PM, Brendan Eich bren...@mozilla.com wrote: An essential part of this proposal is a paren-free call syntax Why is that essential? When I

Re: block lambda revival

2011-05-21 Thread Peter Michaux
On Sat, May 21, 2011 at 7:56 AM, Rick Waldron waldron.r...@gmail.com wrote: Brendan, Thanks for the clarification on that. I've been following the shorter function syntax discussions pretty closely, as well as reading the strawman proposals, so please forgive me if this has been addressed or

Re: Function syntax

2011-05-21 Thread Peter Michaux
, Alex Russell a...@dojotoolkit.org wrote: I'm sorry, this this argument is entirely circular:  - we have something that works  - it could be better  - but it works, so we don't need anything better ? On May 21, 2011, at 10:08 AM, Peter Michaux wrote: On Thu, May 19, 2011 at 12:44 PM, Nathan

Re: Function syntax

2011-05-21 Thread Peter Michaux
On Sat, May 21, 2011 at 10:46 AM, Brendan Eich bren...@mozilla.com wrote: Saying JS has function expressions that are wildly popular is jumping to a conclusion. How is that jumping to conclusions? All the JavaScript code that I read uses function expressions. JS is popular in that it's the

Re: block lambda revival

2011-05-21 Thread Peter Michaux
On Sat, May 21, 2011 at 10:50 AM, Brendan Eich bren...@mozilla.com wrote: On May 21, 2011, at 9:50 AM, Peter Michaux wrote: In another thread, some people were suggesting {||} as an exact alternative to the thin arrow. Yes, I cited the thread in the strawman. So what? Chopping proposals

Re: block lambda revival

2011-05-21 Thread Peter Michaux
On Sat, May 21, 2011 at 10:38 AM, Jorge jo...@jorgechamorro.com wrote: Why the (sudden) urge to copy so many bits ( paren-free, - // =, etc ) of coffee's syntax ? I agree. I don't see how Coffeescript deserves to be such a strong influence with such a short history and limited use. (does JS

Re: block lambda revival

2011-05-21 Thread Peter Michaux
On Sat, May 21, 2011 at 11:09 AM, Brendan Eich bren...@mozilla.com wrote: 'lambda' is not reserved and still overlong. TC39 and this list have been over this ground before. I don't see anything new in your post to change the outcome. TC39 will not introduce *any* new keywords to the

Re: block lambda revival

2011-05-21 Thread Peter Michaux
everyone will try to do the same. Dave On May 21, 2011, at 10:05 AM, Peter Michaux wrote: On Sat, May 21, 2011 at 7:56 AM, Rick Waldron waldron.r...@gmail.com wrote: Brendan, Thanks for the clarification on that. I've been following the shorter function syntax discussions pretty closely

Re: block lambda revival

2011-05-21 Thread Peter Michaux
On Sat, May 21, 2011 at 11:36 AM, Brendan Eich bren...@mozilla.com wrote: What part of integrated design was unclear? None of it. If somehow the whole is rejected, we can pluck out parts and propose them separately, or better: as part of alternative integrated designs. Understood. Neither

Re: block lambda revival

2011-05-20 Thread Peter Michaux
On Fri, May 20, 2011 at 5:54 PM, Brendan Eich bren...@mozilla.com wrote: As promised/threatened: http://wiki.ecmascript.org/doku.php?id=strawman:block_lambda_revival From page: An essential part of this proposal is a paren-free call syntax Why is that essential? Peter

Re: arrow syntax unnecessary and the idea that function is too long

2011-05-17 Thread Peter Michaux
On Tue, May 17, 2011 at 10:50 AM, Axel Rauschmayer a...@rauschma.de wrote: On May 17, 2011, at 4:57, Peter Michaux petermich...@gmail.com wrote: The goal of pleasing compiler writers should be to make it possible to compile existing languages like Perl, Ruby, Python and Scheme to JavaScript

Re: arrow syntax unnecessary and the idea that function is too long

2011-05-16 Thread Peter Michaux
On Mon, May 9, 2011 at 6:02 PM, Brendan Eich bren...@mozilla.com wrote: Yes, and we could add call/cc to make (some) compiler writers even happier. But users would shoot off all their toes with this footgun, and some implementors would be hard-pressed to support it. The point is *not * to do

Re: arrow syntax unnecessary and the idea that function is too long

2011-05-08 Thread Peter Michaux
On Sat, May 7, 2011 at 4:17 PM, David Herman dher...@mozilla.com wrote: But we are going to have to make a decision, and it simply won't be perfect. We're going to listen to everyone, consider the technical issues, and at the end of the day, make the best decision we can with imperfect

Re: arrow syntax unnecessary and the idea that function is too long

2011-05-08 Thread Peter Michaux
On Sun, May 8, 2011 at 11:34 AM, Irakli Gozalishvili rfo...@gmail.com wrote: I'd like to point out that coffeescript has a huge success and in the end it's just syntax sugared js. Can someone give evidence that Coffeescript is actually a success? Has anyone crawled the web to determine the

Re: arrow syntax unnecessary and the idea that function is too long

2011-05-07 Thread Peter Michaux
On Fri, May 6, 2011 at 10:49 PM, Andrew Dupont mozi...@andrewdupont.net wrote: On May 7, 2011, at 12:42 AM, Peter Michaux wrote: Yes and readability counts. JavaScript's function syntax is already *highly* usable and readable. Many people, including me, would disagree. Do you really

Re: arrow syntax unnecessary and the idea that function is too long

2011-05-07 Thread Peter Michaux
On Fri, May 6, 2011 at 11:05 PM, Andrew Dupont mozi...@andrewdupont.net wrote: I don't want to get too deep into matters of taste, but I do think the current syntax is annoyingly verbose for passing lambdas as arguments in other functions. The fact that it's so verbose ends up hurting

Re: arrow syntax unnecessary and the idea that function is too long

2011-05-07 Thread Peter Michaux
On Sat, May 7, 2011 at 6:04 AM, Sam Tobin-Hochstadt sa...@ccs.neu.edu wrote: On Sat, May 7, 2011 at 2:22 AM, Peter Michaux petermich...@gmail.com wrote: I think that this is what compilers and projects like coffeescript are for. In my opinion, JavaScript itself doesn't need this new syntax

Re: es-discuss Digest, Vol 51, Issue 5

2011-05-07 Thread Peter Michaux
On Sat, May 7, 2011 at 9:16 AM, Thaddee Tyl thaddee@gmail.com wrote: I believe that David Bruant has a good point. We *need* a shorter syntax because we advocate the use of map/reduce, etc., which require simple anonymous functions. No. We don't need syntactic sugar. The current function

Re: arrow syntax unnecessary and the idea that function is too long

2011-05-07 Thread Peter Michaux
On Sat, May 7, 2011 at 9:56 AM, Thaddee Tyl thaddee@gmail.com wrote: JavaScript is still seen as a badly object-oriented programming language by those who still think it is java with a weird syntax. I think that concpetion has declined a lot as rich clients have forced people to become

arrow syntax unnecessary and the idea that function is too long

2011-05-06 Thread Peter Michaux
I read Brendan's recent article http://brendaneich.com/2011/05/my-jsconf-us-presentation/ He asked for community members to make their feelings known and the es-discuss list as one of the places to do it. In his article, Brendan shows a slide with the following content

Re: arrow syntax unnecessary and the idea that function is too long

2011-05-06 Thread Peter Michaux
On Fri, May 6, 2011 at 6:39 PM, Brendan Eich bren...@mozilla.com wrote: But again, you can use 14 characters if you want. The problem is that the author of the code that I'm reading may have used the arrow syntax and then I'm stuck reading it. This is shorthand, and only shorthand. And

access to Unicode SMP?

2009-10-13 Thread Peter Michaux
ES5 Section 7.8.4 discusses UnicodeEscapeSequence which have four hexidecimal digits (i.e. \u to \u) and allows specification of characters on the Unicode Basic Multilingual Plane. Is it possible in ECMAScript to specify characters on higher planes like the Supplementary Multilingual

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: Improving ECMAScript as a compilation target

2009-05-05 Thread Peter Michaux
On Mon, May 4, 2009 at 2:34 PM, Brendan Eich bren...@mozilla.com 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 Comments welcome. Thanks for

Re: Operators ||= and =

2009-05-05 Thread Peter Michaux
On Mon, May 4, 2009 at 10:26 PM, Brendan Eich bren...@mozilla.com wrote: ??= and ?? are too narrowly typed for JS. I had the impression from the previous thread that you were more in favor of ??= than ||=. People often write the following at the beginning of functions for optional parameters

Re: Ecma Press Release regarding ECMA-262, 5th Edition Candidate Specificaiton

2009-04-12 Thread Peter Michaux
On Thu, Apr 9, 2009 at 5:29 PM, Allen Wirfs-Brock allen.wirfs-br...@microsoft.com wrote: Ecma has published their press release announcing that the next version of the ECMAScript standard will be known as ECMA-262, Fifth Edition Four is an unlucky number in Japan anyway ;-) Peter

Re: Improving ECMAScript as a compilation target

2009-02-12 Thread Peter Michaux
On Thu, Feb 12, 2009 at 9:17 PM, Brendan Eich bren...@mozilla.com wrote: On Feb 12, 2009, at 8:07 PM, Peter Michaux wrote: SpiderMonkey has had __noSuchMethod__ for years. The Ten years complaint you make seems to be against the ECMAScript committee, Not at all and it is unfortunate it came

Re: Improving ECMAScript as a compilation target

2009-02-12 Thread Peter Michaux
On Thu, Feb 12, 2009 at 10:16 PM, Brendan Eich bren...@mozilla.com wrote: On Feb 12, 2009, at 9:41 PM, Peter Michaux wrote: Not at all and it is unfortunate it came across that way. It is at the whole chain of events which is long: for the ECMAScript committee to standardize methodMissing

Re: Preliminary draft of ES-Harmony modules proposal

2009-02-08 Thread Peter Michaux
On Sun, Feb 8, 2009 at 1:06 PM, Dave Herman dher...@ccs.neu.edu wrote: I like many aspects of Ihab and Kris's proposal, but not all. For example which parts do you like or dislike? The reason I ask, it would be great if the ServerJS project could use a reasonably liked subset of the proposal.

Re: Preliminary draft of ES-Harmony modules proposal

2009-02-07 Thread Peter Michaux
On Thu, Jan 22, 2009 at 10:00 PM, ihab.a...@gmail.com wrote: Hi folks, Kris Kowal and I plan to present a proposal for ES-Harmony modules in the upcoming Mountain View meeting. In the interests of giving everyone a chance to read through our ideas ahead of time, we are sharing a draft of

Re: obsoleting the new keyword

2009-01-17 Thread Peter Michaux
On Wed, Jan 14, 2009 at 11:58 AM, Juriy Zaytsev kan...@gmail.com wrote: On Jan 14, 2009, at 1:51 PM, Peter Michaux wrote: [...] Yes. Needing new makes some things unnecessarily bulky. var pts = getRows().map(function(r) {return new Point(r);}); verses just var pts = getRows().map

obsoleting the new keyword

2009-01-14 Thread Peter Michaux
The requirement that JavaScript needed to look like Java has long been lamented. One of the key looks was the new keyword. Many people don't like the use of the new keyword. Although new is here to stay, could we obsolete it when using a class sugar? Peter

Re: obsoleting the new keyword

2009-01-14 Thread Peter Michaux
On Wed, Jan 14, 2009 at 9:40 AM, Mark S. Miller erig...@google.com wrote: On Wed, Jan 14, 2009 at 9:19 AM, Peter Michaux petermich...@gmail.com wrote: The requirement that JavaScript needed to look like Java has long been lamented. One of the key looks was the new keyword. Many people don't

Re: Semantics and abstract syntax of lambdas

2008-12-18 Thread Peter Michaux
On Thu, Dec 18, 2008 at 8:43 AM, Brendan Eich bren...@mozilla.com wrote: On Dec 18, 2008, at 6:45 AM, Lex Spoon wrote: x = x+1 x = {{ var y = x+1; y*2 }} There's no need to double braces in the = syntax if we require an object initialiser to be parenthesized: x = ({p: 1, q: true}) Why

Re: Simple tail calls

2008-12-06 Thread Peter Michaux
I think tail calls is really an es-discuss (i.e. not es3.x-discuss) topic so I've added that list. Brendan commented to me about tail calls https://mail.mozilla.org/pipermail/es-discuss/2008-July/006566.html I created a Mozilla ticket in response and one of my comments there talks about the

Re: Allen's lambda syntax proposal

2008-12-04 Thread Peter Michaux
2008/12/4 Mark S. Miller [EMAIL PROTECTED]: Welcome to the syntax races. lambda takes an early lead, but drops back because of too much weight. For a while, it's neck and neck between || and ^, with \ following closely and fn, , and other trailing. Many old timers (including your commentator)

Re: Allen's lambda syntax proposal

2008-12-04 Thread Peter Michaux
2008/11/29 Brendan Eich [EMAIL PROTECTED]: At the TC39 meeting two weeks ago in Kona, we had a brief bikeshedding discussion about lambda syntax and why it matters. Who would have thought a discussion about lambda syntax in JavaScript would go over 120 posts while a simultaneous thread about

Re: Allen's lambda syntax proposal

2008-12-03 Thread Peter Michaux
2008/12/3 Michael [EMAIL PROTECTED]: If I understand the proposals correctly, then of the following e4x: Why do you mention e4x? I'm not familiar with it but thought it only adds XML literals to the language. Peter var doc = {{|a,b,c|...}(d,e,f)} var doc = {^(a,b,c){...}(d,e,f)} var

Re: Allen's lambda syntax proposal

2008-12-03 Thread Peter Michaux
Summary of what I've read: The syntax \(){} has a named lambda problem if the lambda name starts with a 'u'. Depending on whitespace between the backslash and the identifier seems like it will cause bugs \u03c0(){} \ u03c0(){} The syntax ^(){} has a semicolon insertion ambiguity. What does

Re: Allen's lambda syntax proposal

2008-12-03 Thread Peter Michaux
2008/12/3 Yuh-Ruey Chen [EMAIL PROTECTED]: The control abstractions just don't look right, regardless of which lambda syntax we choose. I'd rather wait for a more powerful macro system, instead of choosing the syntax based off how it would look in control abstractions. I agree completely.

Re: Allen's lambda syntax proposal

2008-12-03 Thread Peter Michaux
On Wed, Dec 3, 2008 at 7:16 PM, Eric Suen [EMAIL PROTECTED] wrote: Yes, it doesn't contain a lambda expression, just like: a = x /x/i is not same as: a = x; /x/i they both right but has different meaning... Is adding more confusion like this in the language desirable? Peter

Re: Allen's lambda syntax proposal

2008-12-02 Thread Peter Michaux
2008/12/2 Jeff Watkins [EMAIL PROTECTED]: Since the goal seems to be allowing control structures like Smalltalk (yay!), how about specifying that one lambda that follows a function invocation is passed as the final argument to the invocation. Brendan seemed to reject the idea that this could

Re: How much sugar do classes need?

2008-12-02 Thread Peter Michaux
On Tue, Dec 2, 2008 at 1:40 PM, Jon Zeppieri [EMAIL PROTECTED] wrote: #{ ... } is an object initializer where all of the initialized properties are non-configurable. The use of '#' makes me think of reader macros. I like the idea of reader macros for ES. (I don't know if '#' can be used

Re: Allen's lambda syntax proposal

2008-12-02 Thread Peter Michaux
On Tue, Dec 2, 2008 at 4:08 PM, Yuh-Ruey Chen [EMAIL PROTECTED] wrote: (As a side note, sometimes I wonder if all this talk about sugar is moot, because I suspect more and more languages will start compiling down to ES.) I keep a list of all the X-ES3 compilers I encounter in the middle of

Re: Allen's lambda syntax proposal

2008-12-02 Thread Peter Michaux
On Tue, Dec 2, 2008 at 7:11 PM, Neil Mix [EMAIL PROTECTED] wrote: How's this for a strawman: the choice is to follow either Objective-C or Smalltalk. Or Scheme which, after all, was the first Lisp with lexical scoping and first-class lambdas. Peter

Re: Allen's lambda syntax proposal

2008-12-01 Thread Peter Michaux
On Mon, Dec 1, 2008 at 2:06 AM, Chris Pine [EMAIL PROTECTED] wrote: Brendan Eich wrote: // Instead of lambda (a, b, c) { ... }, why not: { |a, b, c| ... } ? Looks like Ruby to me, so you know I love it. :) Nice lambda syntax really matters. If that tool is too heavy, I only use it half

Re: Allen's lambda syntax proposal

2008-12-01 Thread Peter Michaux
On Mon, Dec 1, 2008 at 7:31 AM, P T Withington [EMAIL PROTECTED] wrote: On 2008-11-30, at 01:30EST, Brendan Eich wrote: // Instead of lambda (a, b, c) { ... }, why not: { |a, b, c| ... } ? I would rather have a more literate syntax, lest we degenerate to where practically any comic book

Re: Allen's lambda syntax proposal

2008-12-01 Thread Peter Michaux
On Mon, Dec 1, 2008 at 10:24 AM, Brendan Eich [EMAIL PROTECTED] wrote: On Dec 1, 2008, at 10:17 AM, Peter Michaux wrote: Take an ES program and replace all if-else with ?: and then most functions with {||} and it starts to look quite cryptic. But functions remain. I doubt lambdas in any

Re: Allen's lambda syntax proposal

2008-12-01 Thread Peter Michaux
On Mon, Dec 1, 2008 at 12:19 PM, Allen Wirfs-Brock [EMAIL PROTECTED] wrote: JavaScript already has a concise ASCII vomit syntax for constructing arrays and objects. I didn't mean to imply that JavaScript currently deserves the ASCII vomit label. I also didn't mean to imply the {||} was so bad

Re: Trac issue reports

2008-12-01 Thread Peter Michaux
On Mon, Dec 1, 2008 at 2:18 PM, Brendan Eich [EMAIL PROTECTED] wrote: You two have trac accounts at http://bugs.ecmascript.org/ - Thanks. Hopefully non-committee members can be of some assistance. Peter ___ Es-discuss mailing list

Re: RE: Allen's lambda syntax proposal

2008-12-01 Thread Peter Michaux
On Mon, Dec 1, 2008 at 5:37 PM, Allen Wirfs-Brock [EMAIL PROTECTED] wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:es-discuss- [EMAIL PROTECTED] On Behalf Of Douglas Crockford ... because you can think of the \ as being an abbreviation of function. \ name(a,b,c) {} Just

  1   2   >