Re: Conditional catch clause

2012-12-20 Thread John J Barton
On Wed, Dec 19, 2012 at 11:43 PM, Brendan Eich bren...@mozilla.com wrote: John J Barton wrote: I'll tell you straight out that TC39 should pay more attention to debugging. How would that work? Debuggers are evolving rapidly, should we standardize one now? TC39 has a good cohort of JS

Re: Conditional catch clause

2012-12-20 Thread John J Barton
On Thu, Dec 20, 2012 at 11:20 AM, Brendan Eich bren...@mozilla.com wrote: John J Barton wrote: On Wed, Dec 19, 2012 at 11:43 PM, Brendan Eich bren...@mozilla.commailto: bren...@mozilla.com wrote: In JS, it's a lot easier with the VM support for filtering based on exception type

Re: Conditional catch clause

2012-12-20 Thread John J Barton
On Thu, Dec 20, 2012 at 12:38 PM, Brendan Eich bren...@mozilla.com wrote: John J Barton wrote: Depending on the design, this could be anywhere from only errors raise exceptions to developers must supply a algorithm to decide. Languages with a centrally controlled

Re: Conditional catch clause

2012-12-20 Thread John J Barton
On Thu, Dec 20, 2012 at 2:16 PM, Brendan Eich bren...@mozilla.com wrote: John J Barton wrote: On Thu, Dec 20, 2012 at 12:38 PM, Brendan Eich bren...@mozilla.commailto: bren...@mozilla.com wrote: John J Barton wrote: Java is one example of a language that supports non-error

Re: Conditional catch clause

2012-12-19 Thread John J Barton
On Wed, Dec 19, 2012 at 8:11 AM, Brandon Benvie bran...@brandonbenvie.comwrote: The magical quality that throw has is its ability to end multiple call frames at once. Much like a second continuation channel, or the error channel in a promise, it escapes past any number of listeners on the

Re: Conditional catch clause

2012-12-19 Thread John J Barton
On Wed, Dec 19, 2012 at 11:23 AM, Brendan Eich bren...@mozilla.com wrote: John J Barton wrote: On Wed, Dec 19, 2012 at 8:11 AM, Brandon Benvie bran...@brandonbenvie.com mailto:brandon@brandonbenvie.**combran...@brandonbenvie.com wrote: The magical quality that throw has is its

Re: Conditional catch clause

2012-12-19 Thread John J Barton
On Wed, Dec 19, 2012 at 7:55 PM, Brendan Eich bren...@mozilla.com wrote: John J Barton wrote: On Wed, Dec 19, 2012 at 11:23 AM, Brendan Eich bren...@mozilla.commailto: bren...@mozilla.com wrote: The value of (2) is low but real. I disagree. (2) is essential exactly because we depend

Re: Conditional catch clause

2012-12-19 Thread John J Barton
On Wed, Dec 19, 2012 at 8:01 PM, Brendan Eich bren...@mozilla.com wrote: John J Barton wrote: Debuggers provide break-on-exception as a valuable development feature. Why? Because developers know that an exception is something the merits special attention. If we want to invest in throw/catch

8.2.4 The Reference Specification Type

2012-12-18 Thread John J Barton
I'm trying to decode section 8.2.4 The Reference Specification Type I believe that it is trying to say obj.prop = ... obj is reference base prop is reference name But base can also be Boolean, String, Number and env. record. I can't figure out what a reference name means in these cases. I

Re: 8.2.4 The Reference Specification Type

2012-12-18 Thread John J Barton
On Tue, Dec 18, 2012 at 11:39 AM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: ... I'r all in 8.2.4.1 and 8.2.4.2 (GetValue/SetValue). Consider an expression like: 123.0.toFixed This evaluates to a Reference value {base: 0, referenced name: toFixed, strict: false} (or strict is

Re: Object.define == Object.mixin??

2012-12-12 Thread John J Barton
On Wed, Dec 12, 2012 at 9:42 AM, Brandon Benvie bran...@brandonbenvie.comwrote: Ah yes errors. It should probably have similar semantics to how defineProperties works now...attempting each property and holding errors until the end, no? Same for assign. No, we want early errors and accurate

Re: Object.define == Object.mixin??

2012-12-12 Thread John J Barton
On Wed, Dec 12, 2012 at 10:05 AM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: On Dec 12, 2012, at 9:50 AM, John J Barton wrote: ... But most of all we want this feature to land and not just spin around here. jjb As Object.mixin or as Object.define?? Object.mixin jjb

Re: Object.define == Object.mixin??

2012-12-12 Thread John J Barton
On Wed, Dec 12, 2012 at 10:18 AM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: On Dec 12, 2012, at 10:05 AM, Brandon Benvie wrote: All the Object functions that operate on multiple properties are currently specified using *pendingException* which reports the first thrown exception after

Re: Object.define == Object.mixin??

2012-12-12 Thread John J Barton
On Wed, Dec 12, 2012 at 10:44 AM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: On Dec 12, 2012, at 10:23 AM, John J Barton wrote: On Wed, Dec 12, 2012 at 10:18 AM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Dec 12, 2012, at 10:05 AM, Brandon Benvie wrote: All the Object

Re: Object.define == Object.mixin??

2012-12-12 Thread John J Barton
On Wed, Dec 12, 2012 at 11:20 AM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: On Dec 12, 2012, at 10:52 AM, John J Barton wrote: On Wed, Dec 12, 2012 at 10:44 AM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Dec 12, 2012, at 10:23 AM, John J Barton wrote: On Wed, Dec 12

Re: Object.define == Object.mixin??

2012-12-12 Thread John J Barton
On Wed, Dec 12, 2012 at 11:13 AM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: On Dec 12, 2012, at 10:10 AM, John J Barton wrote: On Wed, Dec 12, 2012 at 10:05 AM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Dec 12, 2012, at 9:50 AM, John J Barton wrote: ... But most of all we

Re: Comments on Meeting Notes

2012-12-05 Thread John J Barton
On Tue, Dec 4, 2012 at 1:28 PM, Brendan Eich bren...@mozilla.org wrote: Mark S. Miller wrote: On Tue, Dec 4, 2012 at 10:48 AM, Brendan Eichbren...@mozilla.org wrote: Kevin Smith wrote: I recommend allowing let declarations only in strict mode. This is the simple, backwards-compatible

Re: A new function name property proposal

2012-11-16 Thread John J Barton
You might be interested in the work of Salman Mirghasemi on anonymous function naming in JavaScript: http://johnjbarton.github.com/nonymous/index.html jjb On Fri, Nov 16, 2012 at 11:34 AM, Aron Homberg i...@aron-homberg.de wrote: I implemented a JS parser last week (in JS) which specially

Re: Promises

2012-11-09 Thread John J Barton
On Fri, Nov 9, 2012 at 4:33 AM, David Bruant bruan...@gmail.com wrote: Hi, In this message, I'll be sharing some experience I've had with the Q library. I have worked with it for about 7-8 months in a medium/big Node.js application (closed source, so I can't link, sorry). I'll be covering

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

2012-11-07 Thread John J Barton
On Wed, Nov 7, 2012 at 9:17 AM, Axel Rauschmayer a...@rauschma.de wrote: In theory, one can use prototype properties to provide default values for instance properties. In practice instances are free to write on these values in addition to using them as defaults. Then suddenly the 'default' is

Re: `free` operator

2012-10-26 Thread John J Barton
On Thu, Oct 25, 2012 at 5:58 PM, Isaac Schlueter i...@izs.me wrote: johnjbar...@johnjbarton.com wrote: var obj = {} var foo = { ref: obj } I assume that in your real life, you don't know 'foo' but somehow you know that foo.ref is never used? Well, you know that IF foo.ref is used, it's an

Re: `free` operator

2012-10-26 Thread John J Barton
On Fri, Oct 26, 2012 at 11:58 AM, Isaac Schlueter i...@izs.me wrote: So, yes, you can certainly use debugging tools to find which objects are leaking. But, there are times when you have a program where something is leaking, and you read through the code, and see that there is no possible way

Re: `free` operator

2012-10-26 Thread John J Barton
complete UI. Isaac could then solve his problem trivially by adding a debugger where he would have called free and look at what other places in the source are still holding references. I hope for trivially but I'll settle for with relative ease. jjb On Fri, Oct 26, 2012 at 12:34 PM, John J

Re: `free` operator

2012-10-25 Thread John J Barton
On Thu, Oct 25, 2012 at 4:16 PM, Isaac Schlueter i...@izs.me wrote: It'd be really nice if JS had a way to explicitly delete an object. I guess you mean ... a way to set all the refs to a object to undefined. What do you folks think about a free operator (or something like it) that would

Re: `free` operator

2012-10-25 Thread John J Barton
On Oct 25, 2012 8:42 PM, Domenic Denicola dome...@domenicdenicola.com wrote: The new thing this proposal brings to the table is the ability to mark, from within your code, exactly what object you're worried about the leakiness of. You also get very understandable error messages for determining

Re: Avoiding overloading the term “prototype”

2012-10-23 Thread John J Barton
On Tue, Oct 23, 2012 at 8:53 AM, Brendan Eich bren...@mozilla.org wrote: I'm in the same boat. I see the attraction, very long run. Perhaps others will weigh in. I guess very few developers off this list know that [[Prototype]] exists. That is, the special double square bracket syntax is not

Re: Modules, Concatenation, and Better Solutions

2012-10-17 Thread John J Barton
Maybe this is already obvious, but if modules are tightly coupled to files then the concatenation really has to be a container of files (eg zip) and it's not part of the language. If multiple modules can be declared in a single file, then concatenation is part of the language and has to work

Re: Modules, Concatenation, and Better Solutions

2012-10-16 Thread John J Barton
On Tue, Oct 16, 2012 at 2:58 PM, David Herman dher...@mozilla.com wrote: On Oct 15, 2012, at 6:45 AM, Kevin Smith khs4...@gmail.com wrote: OK, so: module A { console.log(a); export var x; } console.log($); import x from A; Does this print: Good question.

Re: Modules, Concatenation, and Better Solutions

2012-10-16 Thread John J Barton
On Tue, Oct 16, 2012 at 7:10 PM, David Herman dher...@mozilla.com wrote: On Oct 16, 2012, at 4:51 PM, John J Barton johnjbar...@johnjbarton.com wrote: ... Concrete example: Even and Odd modules refer to each other, but the import statements occur after some initialization: module Odd

Re: should we rename the Program grammar production?

2012-10-11 Thread John J Barton
On Wed, Oct 10, 2012 at 4:20 PM, Rick Waldron waldron.r...@gmail.com wrote: ... Allen Wirfs-Brock wrote: I proposed that we replace Program in this context with Script. This is much less confusing and matches the most common manifestation of an ES Program as an HTML script block. +1 --

Re: should we rename the Program grammar production?

2012-10-11 Thread John J Barton
On Thu, Oct 11, 2012 at 11:03 AM, Brendan Eich bren...@mozilla.com wrote: John J Barton wrote: That is not my understanding, but I don't think it matters: that is an implementation specific notion without consequence. Whether the compiler treats all of the top level statements of ascript tag

Re: should we rename the Program grammar production?

2012-10-10 Thread John J Barton
+1 Tracuer uses 'Program' and that makes it too easy to forget that the program consists of multiple Program-s jjb On Wed, Oct 10, 2012 at 11:56 AM, Brendan Eich bren...@mozilla.com wrote: Allen Wirfs-Brock wrote: I proposed that we replace Program in this context with Script. This is

Re: should we rename the Program grammar production?

2012-10-10 Thread John J Barton
On Oct 10, 2012 4:20 PM, Rick Waldron waldron.r...@gmail.com wrote: On Wednesday, October 10, 2012 at 6:14 PM, John J Barton wrote: +1 Tracuer uses 'Program' and that makes it too easy to forget that the program consists of multiple Program-s jjb On Wed, Oct 10, 2012 at 11:56 AM

Re: Symbols, Protocols, Frames, and Versioning

2012-10-03 Thread John J Barton
On Oct 3, 2012 12:39 PM, Domenic Denicola dome...@domenicdenicola.com wrote: Would it suffice to allow cross-frame sharing of symbols via postMessage and its structured clone algorithm? They're immutable, right? I'm trying to follow this thread, but I'm having trouble understanding the

Re: global object in strict mode

2012-08-24 Thread John J Barton
On Fri, Aug 24, 2012 at 10:51 AM, Brendan Eich bren...@mozilla.org wrote: Kris Kowal wrote: On Fri, Aug 24, 2012 at 10:41 AM, Brendan Eichbren...@mozilla.org wrote: I'm not sure what the problem is -- I read the old thread, and noticed the solution: var global = Function(return this)();

global object in strict mode

2012-08-23 Thread John J Barton
Long ago this list had a subject: How to retrieve the global object in strict mode? https://mail.mozilla.org/pipermail/es5-discuss/2011-February/003919.html Roughly the conclusion was: var global = (global, eval)(this); However Content Security Policy

Re: global object in strict mode

2012-08-23 Thread John J Barton
with a window variable redefined. On Thu, Aug 23, 2012 at 11:59 PM, John J Barton johnjbar...@johnjbarton.com wrote: Long ago this list had a subject: How to retrieve the global object in strict mode? https://mail.mozilla.org/pipermail/es5-discuss/2011-February/003919.html Roughly

Re: Experimental implementation of Object.observe JS Utility library now available

2012-08-20 Thread John J Barton
On Sun, Aug 19, 2012 at 3:31 PM, Rafael Weinstein rafa...@chromium.orgwrote: On Sun, Aug 19, 2012 at 11:25 AM, John J Barton johnjbar...@johnjbarton.com wrote: On Fri, Aug 17, 2012 at 9:49 PM, Rafael Weinstein rafa...@chromium.org wrote: A synchronous observation mechanism provides

Re: strawman for the := operator

2012-08-08 Thread John J Barton
On Wed, Aug 8, 2012 at 4:52 PM, Brendan Eich bren...@mozilla.org wrote: David Herman wrote: On Aug 8, 2012, at 3:08 PM, Axel Rauschmayer wrote: I'm not yet convinced that Object.update should be restricted to own properties. If you're only using object literals, then yeah, you want own

Re: Template strings and templates

2012-08-05 Thread John J Barton
On Sat, Aug 4, 2012 at 1:22 PM, Mark Miller erig...@gmail.com wrote: It is a matter of definition and taste, but I don't think it is useful to think of these as macros. I expect macros to extend the base language as if adding new special forms, where these special forms are stylistically

Re: Template strings and templates

2012-08-04 Thread John J Barton
On Fri, Aug 3, 2012 at 10:30 PM, Axel Rauschmayer a...@rauschma.de wrote: Ah, OK. Spitballing: A synonym of tag then, maybe? Alas, label is out. If the term was, say, “mark” then one could conceivably say “mark function” instead of handler. Aren't these macros?

Re: Static Module Resolution

2012-06-30 Thread John J Barton
On Sat, Jun 30, 2012 at 11:24 AM, Kevin Smith khs4...@gmail.com wrote: Thanks Dave, for writing your blog post - it definitely cleared up some things for me (macros in particular). If there were no module systems already in place, I would definitely agree with static resolution. However, it

Re: Static Module Resolution

2012-06-30 Thread John J Barton
On Sat, Jun 30, 2012 at 12:03 PM, Kevin Smith khs4...@gmail.com wrote: Just define the order of execution between ES6 and pre-ES6 to run legacy.js first. You'd have to detect (before execution) whether a script was ES6 or not, which is not practical, AFAICT. As Dave suggests, my gut

Re: Modules: execute deps, modify, execute (was Re: ES Modules: suggestions for improvement)

2012-06-27 Thread John J Barton
On Wed, Jun 27, 2012 at 9:47 AM, James Burke jrbu...@gmail.com wrote: The discussion on what is allowed, in particular import *, could still happen, but at least there would be a baseline that would allow for them in a way that makes it easier for existing code to transition to the new

Re: Error stack

2012-06-07 Thread John J Barton
On Thu, Jun 7, 2012 at 11:37 AM, Erik Arvidsson erik.arvids...@gmail.com wrote: I wrote a new strawman for Error stack which is now available in some form in all major browser (if betas are considered). http://wiki.ecmascript.org/doku.php?id=strawman:error_stack Feedback wanted. You might

Re: TC39 meeting Wed 5/23/2012

2012-05-30 Thread John J Barton
On Wed, May 30, 2012 at 12:45 AM, David Bruant bruan...@gmail.com wrote: Le 29/05/2012 21:18, John J Barton a écrit : On Tue, May 29, 2012 at 11:32 AM, Brendan Eichbren...@mozilla.org  wrote: John J Barton wrote: This is one of those cases where a small delta creates a very large negative

Re: TC39 meeting Wed 5/23/2012

2012-05-29 Thread John J Barton
On Mon, May 28, 2012 at 11:23 PM, Brendan Eich bren...@mozilla.org wrote: John J Barton wrote: On Mon, May 28, 2012 at 10:09 PM, Allen Wirfs-Brock al...@wirfs-brock.com  wrote: On May 28, 2012, at 10:03 PM, John J Barton wrote: So let's rewind to my original question.  If the discussion

Re: TC39 meeting Wed 5/23/2012

2012-05-29 Thread John J Barton
On Tue, May 29, 2012 at 11:32 AM, Brendan Eich bren...@mozilla.org wrote: John J Barton wrote: This is one of those cases where a small delta creates a very large negative effect. Evidence? If you look back on this thread you will see an example extracted from the case that caused me pain

Re: TC39 meeting Wed 5/23/2012

2012-05-29 Thread John J Barton
On Tue, May 29, 2012 at 12:08 PM, Anton Kovalyov m...@kovalyov.net wrote: FWIW I don't think it's even possible to use JSLint and 'with'. The parser just quits as if it was a syntax error. Yes this is correct. Anton On Tuesday, May 29, 2012 at 11:40 AM, Brendan Eich wrote: John Tamplin

Re: TC39 meeting Wed 5/23/2012

2012-05-28 Thread John J Barton
On May 28, 2012 2:53 AM, T.J. Crowder t...@crowdersoftware.com wrote: On 28 May 2012 06:37, John J Barton johnjbar...@johnjbarton.com wrote: A library writer creates an object in one scope and all of their tests succeed. I use it another scope and my code fails. We are both using legal

Re: TC39 meeting Wed 5/23/2012

2012-05-28 Thread John J Barton
On Mon, May 28, 2012 at 10:50 AM, T.J. Crowder t...@crowdersoftware.com wrote: On 28 May 2012 18:46, Russell Leggett russell.legg...@gmail.com wrote: Perhaps this discussion would be aided by a more concrete example. Doh! Excellent idea. John, if you'd like...? (Otherwise I can do one.)

Re: TC39 meeting Wed 5/23/2012

2012-05-28 Thread John J Barton
On Mon, May 28, 2012 at 9:33 PM, John Tamplin j...@google.com wrote: On Tue, May 29, 2012 at 12:07 AM, John J Barton johnjbar...@johnjbarton.com wrote: function app() {  var r = makeExample();  r.discover = function() {    console.log(I want to call this function);    return 1

Re: TC39 meeting Wed 5/23/2012

2012-05-28 Thread John J Barton
On Mon, May 28, 2012 at 9:41 PM, Russell Leggett russell.legg...@gmail.com wrote: On Tue, May 29, 2012 at 12:07 AM, John J Barton johnjbar...@johnjbarton.com wrote: On Mon, May 28, 2012 at 10:50 AM, T.J. Crowder t...@crowdersoftware.com wrote: On 28 May 2012 18:46, Russell Leggett

Re: TC39 meeting Wed 5/23/2012

2012-05-28 Thread John J Barton
On Mon, May 28, 2012 at 9:54 PM, John Tamplin j...@google.com wrote: On Tue, May 29, 2012 at 12:45 AM, John J Barton johnjbar...@johnjbarton.com wrote: The only question is whether you get an exception when you create discover() or when you call it.  Your code can choose or not to treat

Re: TC39 meeting Wed 5/23/2012

2012-05-27 Thread John J Barton
On Thu, May 24, 2012 at 11:10 AM, Brendan Eich bren...@mozilla.com wrote: David Bruant wrote: Once we're at it, for the sake of completeness there is probably no harm in adding a Reflect.setPrototype at this point, is there? There is, just as there's a cost to Object.setPrototypeOf (the

Re: TC39 meeting Wed 5/23/2012

2012-05-27 Thread John J Barton
On Sun, May 27, 2012 at 4:41 PM, Brendan Eich bren...@mozilla.com wrote: John J Barton wrote: On Thu, May 24, 2012 at 11:10 AM, Brendan Eichbren...@mozilla.com  wrote: David Bruant wrote: Once we're at it, for the sake of completeness there is probably no harm in adding

Re: TC39 meeting Wed 5/23/2012

2012-05-27 Thread John J Barton
On Sun, May 27, 2012 at 6:04 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On May 27, 2012, at 5:13 PM, John J Barton wrote: ... The reason I asked is that use strict seems to be a subset but acts like another version in some cases. In particular, if a library uses obj.freeze

Re: TC39 meeting Wed 5/23/2012

2012-05-27 Thread John J Barton
On Sun, May 27, 2012 at 10:09 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: ... First rule of strict mode:  use strict only affects code that is lexically within the scope of the directive.  It has no global effect. My example contradicts this claim. No, read the spec.  You seem to be

Re: minutes, TC39 meeting Tues 5/22/2012

2012-05-23 Thread John J Barton
On Wed, May 23, 2012 at 10:08 PM, Domenic Denicola dome...@domenicdenicola.com wrote: * Traceur seems to be coming along nicely, but its alignment with the spec leaves a lot to be desired. Destructuring just got fixed a few days ago, and they have a class syntax you have to avoid to write

Re: catch vs function scope; var declaration vs initialization

2012-05-14 Thread John J Barton
On Mon, May 14, 2012 at 3:25 AM, T.J. Crowder t...@crowdersoftware.com wrote: Inside the catch, the catch-scope is first for reading and writing. But the catch scopes are ignored for declaring new variables. So your expectation seems to be the correct one. That was my analysis as well.

Re: Reflect.parse (from RE:typeof null)

2012-05-10 Thread John J Barton
On Thu, May 10, 2012 at 8:28 AM, Claus Reinke claus.rei...@talk21.com wrote: Will Reflect.parse be standardized? Maybe. It's too late for ES6 and different implementations have different concrete parse trees, I bet -- although perhaps they all agree on concrete, there's still the question of

Re: TC39 bashing

2012-05-09 Thread John J Barton
+1 too all this On Wed, May 9, 2012 at 7:44 PM, Mikeal Rogers mikeal.rog...@gmail.com wrote: What is the goal of this? If the goal is to get people to stop complaining, don't bother, people will always complain. So long as there is a TC-39 there will be people that strive to be armchair

Re: typeof null

2012-05-08 Thread John J Barton
On Tue, May 8, 2012 at 6:07 PM, Brendan Eich bren...@mozilla.org wrote: Object class reflection is frowned upon in Smalltalk for a reason. We want protocols, structural conventions -- not nominal type tags. Or so I think! Perhaps it would be helpful if someone made the case for typeof null ===

Re: Arrow binding

2012-04-23 Thread John J Barton
On Mon, Apr 23, 2012 at 3:53 AM, Alex Russell a...@dojotoolkit.org wrote: The new forms we're adding (methods and arrows) have the potential to change this radically, causing a large percentage of functions encountered by programmers to have binding. If that binding is hard-binding, .call()

Re: A few arrow function specification issues

2012-04-23 Thread John J Barton
Ok I gotta testify for the other side: use strict is not all roses. I hit three problems with 'use strict': 1. I wrote the following code in JavaScript: function register(otherWindow, local, options) { var remote = Q_COMM.Connection(otherWindow, local, options); remote.discover =

Re: A few arrow function specification issues

2012-04-23 Thread John J Barton
+1 High integrity engineering of components supports low integrity integration essential for low cost adaptable systems. We have scripting for the same reason we carpenters. We could build a house using a computer milling machine but no one could afford it; we don't want JavaScript to enforce high

Re: Terminology: “non-method function”

2012-04-11 Thread John J Barton
On Tue, Apr 10, 2012 at 4:01 PM, Axel Rauschmayer a...@rauschma.de wrote: What is a good term for functions that don’t have/use dynamic `this`? “Non-method function” defines them by what they aren’t, I would like a positive definition. I’ve considered the term “pure function”, but the

Re: Source Map Standard

2012-04-11 Thread John J Barton
On Wed, Apr 11, 2012 at 12:42 PM, Joey Schorr jsch...@gmail.com wrote: Do I have constraints in my compiler (do I need to ship in a certain way)? No, you just need to provide the source map file with your code. This 'provide' step is a bit of a headache since it means you have to coordinate

Re: Extra functions on Arrays, Maps, etc..

2012-04-10 Thread John J Barton
On Mon, Apr 9, 2012 at 9:17 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: I keep finding the frame problem overrated, specially in this case where the case you are passing DOM nodes between frames is ... well, extremely edge? The frame problem might appear overrated if you

Re: Dynamic this

2012-04-09 Thread John J Barton
On Mon, Apr 9, 2012 at 10:46 AM, Herby Vojčík he...@mailbox.sk wrote: Hello, this is more a conceptual question post. But first some proposals that circulated in the list: 1. Dynamic-this enabled fat arrow functions. (this, ...) = expr (this, ...) = { body } 2. ABC (apply/bind/call)

Re: Modules: compile time linking (was Re: Modules feedback, proposal)

2012-04-06 Thread John J Barton
On Fri, Apr 6, 2012 at 4:54 AM, Sam Tobin-Hochstadt sa...@ccs.neu.eduwrote: On Thu, Apr 5, 2012 at 11:23 PM, John J Barton johnjbar...@johnjbarton.com wrote: On Thu, Apr 5, 2012 at 10:01 AM, James Burke jrbu...@gmail.com wrote: So, assuming Math has no dependencies (just to make

Re: Modules: compile time linking (was Re: Modules feedback, proposal)

2012-04-05 Thread John J Barton
On Thu, Apr 5, 2012 at 10:01 AM, James Burke jrbu...@gmail.com wrote: So, assuming Math has no dependencies (just to make this shorter), the sequence of events: * Load Foo, convert to AST, find from usage. * Load Math * Compile Math * Evaluate Math * Inspect Math's exported module value

Re: Development Mode/Production Mode

2012-04-03 Thread John J Barton
On Tue, Apr 3, 2012 at 7:03 AM, David Bruant bruan...@gmail.com wrote: Le 01/04/2012 13:38, Wes Garland a écrit : In a similar vein, I would personally like to have zero-cost-when-not-debugging assert() statements, and am hopeful that statically-linked modules might lead the way. It seems

Re: Do Maximally Minimal classes carry their weight?

2012-04-02 Thread John J Barton
Allen's original post on this thread offered two choices: 1) extended object literals, (good building blocks). 2) both, (because class gives 80% and thus they complement). Erik and Tab are arguing for 3) Min-max classes (we need 80%, not building blocks). The current winner no one wants:

Re: Modules feedback, proposal

2012-04-01 Thread John J Barton
On Sat, Mar 31, 2012 at 6:30 PM, David Herman dher...@mozilla.com wrote: baseUrl + ID + .js Yeah, I've thought about auto-appending .js. I think you're right that it opens up the possibility to be a little more abstract. Auto-appending makes the API less abstract:the arguments must be

Re: Modules feedback, proposal

2012-04-01 Thread John J Barton
, specifically for script src=, should be adapted with as few changes as possible for out-of-line modules. Yes, even more so if ES delegates to another group for the rest. jjb /be John J Barton wrote: On Sat, Mar 31, 2012 at 6:30 PM, David Herman dher...@mozilla.commailto: dher

Re: Learning from requirejs

2012-03-29 Thread John J Barton
On Thu, Mar 29, 2012 at 4:55 PM, David Herman dher...@mozilla.com wrote: On Mar 29, 2012, at 4:47 PM, John J Barton wrote: And like require.js we will have difficulty resynchronizing the script loading with document loading. For example, the above code may fail if the callback fires before

If not for-in then what?

2012-03-28 Thread John J Barton
In another thread Allen says: we infer from array behavior that for-in was intended to iterate over the data elements of an object and not the behavioral elements (eg methods). Similar comments have been implied around the discussion of enumerable properties. I personally have never seen any

Re: arrow function syntax simplified

2012-03-28 Thread John J Barton
On Tue, Mar 27, 2012 at 9:39 PM, Luke Hoban lu...@microsoft.com wrote: Brendan Eich wrote: Kevin's analysis contradicts your assertion. Expression-bodied functions with bound |this| (or var self=this outside) predominate in the code he surveyed. See thread headed by this message:

Re: If not for-in then what?

2012-03-28 Thread John J Barton
On Wed, Mar 28, 2012 at 8:24 AM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: On Mar 28, 2012, at 8:06 AM, John J Barton wrote: In another thread Allen says: we infer from array behavior that for-in was intended to iterate over the data elements of an object and not the behavioral

Re: Classes: Enumerability of methods and constructor

2012-03-27 Thread John J Barton
/be John J Barton wrote: I appreciate understanding why this choice. (FWIW, I totally don't get why non-enumerable even exists). ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: value objects

2012-03-27 Thread John J Barton
Just a bit related and perhaps of interest: Back when I believed in operator overloading, I wrote a package to allow C++ classes to inherit consistent overloading. The package consisted of templatized base classes that defined say the binary + operator in terms of +=. The base class parameter was

Re: module path resolution

2012-03-25 Thread John J Barton
On Sun, Mar 25, 2012 at 10:09 AM, Axel Rauschmayer a...@rauschma.de wrote: Right. I also like Node’s idea of “global module names”, where a module name is a location-independent identifier, for a module that might be installed locally or globally. I'm not sure what you mean by 'module

Re: simpler, sweeter syntax for modules

2012-03-23 Thread John J Barton
On Thu, Mar 22, 2012 at 10:32 AM, Brendan Eich bren...@mozilla.org wrote: John J Barton wrote: I guess you mean: a special form evaluated before the outer function runs? Surely this form is not off-line. No, before anything in the containing Program (up to the script container) runs

Re: module path resolution

2012-03-23 Thread John J Barton
On Fri, Mar 23, 2012 at 6:14 PM, David Herman dher...@mozilla.com wrote: On Mar 23, 2012, at 5:05 PM, Irakli Gozalishvili wrote: But your question is probably more about what the default policy of the System loader will be on the web. First of all, the System loader's baseURL (should it be

Re: simpler, sweeter syntax for modules

2012-03-22 Thread John J Barton
On Wed, Mar 21, 2012 at 11:33 PM, Brendan Eich bren...@mozilla.org wrote: David Herman wrote: On Mar 21, 2012, at 9:28 PM, John J Barton wrote: equals makes sense when it is assigment:   module Bar = load(bar.js); It's not an assignment, though. Which is why Brendan didn't like

Re: simpler, sweeter syntax for modules

2012-03-22 Thread John J Barton
On Thu, Mar 22, 2012 at 10:32 AM, Brendan Eich bren...@mozilla.org wrote: John J Barton wrote: I guess you mean:  a special form evaluated before the outer function runs? Surely this form is not off-line. No, before anything in the containing Program (up to the script container) runs

Re: simpler, sweeter syntax for modules

2012-03-22 Thread John J Barton
On Thu, Mar 22, 2012 at 1:54 PM, Brendan Eich bren...@mozilla.org wrote: John J Barton wrote: Second, we need a solution for asynchronous loading with run-time selection. We use it now and as we move to much better network layers we will use it a lot more. Of course. This is what the http

Re: simpler, sweeter syntax for modules

2012-03-22 Thread John J Barton
On Thu, Mar 22, 2012 at 3:06 PM, Sam Tobin-Hochstadt sa...@ccs.neu.edu wrote: On Thu, Mar 22, 2012 at 5:11 PM, John J Barton johnjbar...@johnjbarton.com wrote: The module solution posted seems to have a top-notch solution for the static case but the dynamic case is buried in the loader. I

Re: simpler, sweeter syntax for modules

2012-03-22 Thread John J Barton
On Thu, Mar 22, 2012 at 4:54 PM, Brendan Eich bren...@mozilla.org wrote: John J Barton wrote: If I go back to my previous question, can we understand what should happen here? if (version === 1)  import y from 'lib1.js'; else  import y from 'lib2.js'; Again, no. No, we can't understand

Re: Finding a safety syntax for classes

2012-03-21 Thread John J Barton
On Wed, Mar 21, 2012 at 11:52 AM, Russell Leggett russell.legg...@gmail.com wrote: On Wed, Mar 21, 2012 at 2:47 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Mar 21, 2012, at 8:41 AM, Russell Leggett wrote: On Wed, Mar 21, 2012 at 11:12 AM, Kevin Smith khs4...@gmail.com wrote: I

Please some small improvements

2012-03-20 Thread John J Barton
I've been reading a lot of nicely written JS in the Traceur compiler. They use a very conservative Java-like approach with Constructor functions and literal prototype property declarations. Sadly they must include workarounds for Object.create:

Re: Please some small improvements

2012-03-20 Thread John J Barton
On Tue, Mar 20, 2012 at 2:53 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Mar 20, 2012, at 2:10 PM, John J Barton wrote:  Object.merge() that merges the own non-function properties as own properties, the non-built-in-functions as prototype properties. (a compromise of the two common

Re: Please some small improvements

2012-03-20 Thread John J Barton
On Tue, Mar 20, 2012 at 2:53 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Mar 20, 2012, at 2:10 PM, John J Barton wrote: I've been reading a lot of nicely written JS in the Traceur compiler. They use a very conservative Java-like approach with Constructor functions and literal

Re: Please some small improvements

2012-03-20 Thread John J Barton
On Tue, Mar 20, 2012 at 4:34 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Mar 20, 2012, at 3:57 PM, John J Barton wrote: On Tue, Mar 20, 2012 at 2:53 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Mar 20, 2012, at 2:10 PM, John J Barton wrote: ... In ES.next, based upon

Re: Object composition challenge

2012-03-17 Thread John J Barton
On Sat, Mar 17, 2012 at 11:37 AM, David Bruant bruan...@gmail.com wrote: Le 17/03/2012 00:36, John J Barton a écrit : On Fri, Mar 16, 2012 at 4:18 PM, David Bruant bruan...@gmail.com wrote: ... This is a piece of cake with Java's protected. It is much convoluted in JavaScript. I think

Re: Using Object Literals as Classes

2012-03-16 Thread John J Barton
On Fri, Mar 16, 2012 at 3:04 PM, David Bruant bruan...@gmail.com wrote: Unfortunately, methods on prototype require to have properties that are public. If you avoid prototype methods, all your attributes and private methods can be shared by public method scopes. I think you are mixing up

Re: Object composition challenge (was: Using Object Literals as Classes)

2012-03-16 Thread John J Barton
On Fri, Mar 16, 2012 at 4:18 PM, David Bruant bruan...@gmail.com wrote: ... This is a piece of cake with Java's protected. It is much convoluted in JavaScript. I think this kind of problem being hard to solve in JavaScript is the reason why so many frameworks like Node.js make the choice to

Re: Using Object Literals as Classes

2012-03-16 Thread John J Barton
On Fri, Mar 16, 2012 at 6:28 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On this point, I probably should define what I mean by declarative.  I consider code to be declarative, if a human (or an appropriately programmed machine) can understand its meaning without actually (or

Re: BTF Measurements

2012-03-13 Thread John J Barton
On Tue, Mar 13, 2012 at 8:15 AM, Jason Orendorff jason.orendo...@gmail.com wrote: Kevin Smith wrote:  For the surveyed code, the percentage of function expressions which do not reference this ranges between 31% and 87%.  About half of all function expressions are suitable for conversion to

  1   2   3   >