July 24, 2012 - TC39 Meeting Notes

2012-07-27 Thread Rick Waldron
# July 24 2012 Meeting Notes Present: Yehuda Katz (YK), Luke Hoban (LH), Rick Waldron (RW), Alex Russell (AR), Tom Van Cutsem (TVC), Bill Ticehurst (BT), Brendan Eich (BE), Sam Tobin-Hochstadt (STH), Norbert Lindenberg (NL), Allen Wirfs-Brock (AWB), Doug Crockford (DC), John Neumann (JN), Oliver

July 25, 2012 - TC39 Meeting Notes

2012-07-27 Thread Rick Waldron
# July 25 2012 Meeting Notes Present: Mark Miller (MM), Brendan Eich (BE), Yehuda Katz (YK), Luke Hoban (LH), Andreas Rossberg (ARB), Rick Waldron (RW), Alex Russell (AR), Tom Van-Cutsem (TVC), Bill Ticehurst (BT), Rafeal Weinstein (RWS), Sam Tobin-Hochstadt (STH), Allen Wirfs-Brock (AWB), Doug

July 26, 2012 TC39 Meeting Notes

2012-07-27 Thread Rick Waldron
# July 26 2012 Meeting Notes Present: Mark Miller (MM), Brendan Eich (BE), Yehuda Katz (YK), Luke Hoban (LH), Rick Waldron (RW), Alex Russell (AR), Tom Van-Cutsem (TVC), Bill Ticehurst (BT), Sam Tobin-Hochstadt (STH), Allen Wirfs-Brock (AWB), Doug Crockford (DC), John Neumann (JN), Erik Arvidsson

Re: Updates to Object.observe

2012-07-17 Thread Rick Waldron
On Tue, Jul 17, 2012 at 7:49 PM, Erik Arvidsson erik.arvids...@gmail.comwrote: We've done a bunch of updates to Object.observe in preparation for the next weeks face to face meeting. The updates are based on feedback from multiple people but more feedback is always welcome.

Re: Behavior of Array(n).join(s)

2012-07-16 Thread Rick Waldron
On Mon, Jul 16, 2012 at 4:39 PM, Patrick Mulder mulder.patr...@gmail.comwrote: Hello, I am rather new to ES and this group, but I am surprised by this behavior: When I do: Array(4) [undefined, undefined, undefined, undefined] And when I do: Array(4).join( * ) * * * In other

Re: Behavior of Array(n).join(s)

2012-07-16 Thread Rick Waldron
Sorry about the echo, I didn't see the replies come in as I was typing Rick ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: for-of statement of sparse array

2012-07-05 Thread Rick Waldron
On Thursday, July 5, 2012 at 9:18 PM, Brendan Eich wrote: Brendan Eich wrote: This upholes the Array forEach (and all other extras) hole-skipping. The deck is stacked against for(;;) iteration in my view. LOL, This upholds, of course. I had hoped this was a clever pun :)

Re: for-of statement of sparse array

2012-07-05 Thread Rick Waldron
On Thu, Jul 5, 2012 at 6:30 PM, Rick Waldron waldron.r...@gmail.com wrote: On Thursday, July 5, 2012 at 9:18 PM, Brendan Eich wrote: Brendan Eich wrote: This upholes the Array forEach (and all other extras) hole-skipping. The deck is stacked against for(;;) iteration in my view. LOL

Re: var el1,el2 = [1,2] why not?

2012-07-04 Thread Rick Waldron
On Wed, Jul 4, 2012 at 10:31 AM, Hemanth H.M hemanth...@gmail.com wrote: var a,b = 1; sets b to 1 and a is undefined, this is more C like semantics. Where as a,b = b,a is more pythonis; Well then a,b=[1,2] should make sense ? /me also agrees to var[a,b] = foo; It might be helpful to read

Re: Some Array methods don't consider array holes and length

2012-06-26 Thread Rick Waldron
On Tue, Jun 26, 2012 at 9:01 AM, Yusuke Suzuki utatane@gmail.comwrote: For splice, this has already been reported as https://bugs.ecmascript.org/show_bug.cgi?id=332 Oh, I missed it, thanks!! I've added myself to CC. I've added a new bug for slice:

Re: Detecting the type of a DOM object

2012-06-25 Thread Rick Waldron
On Monday, June 25, 2012 at 4:28 AM, Brendan Eich wrote: David Bruant wrote: Le 24/06/2012 14:51, Brendan Eich a écrit : David Bruant wrote: Instead of adding a new [[instanceofHint]] internal property, maybe the [[NativeBrand]] could be reused. +1 on that, which

Re: Detecting the type of a DOM object

2012-06-25 Thread Rick Waldron
On Mon, Jun 25, 2012 at 9:11 AM, David Bruant bruan...@gmail.com wrote: snip Firefox is partially built in JavaScript. This code is considered privileged (by opposition to website JavaScript). More things can be allowed to this JavaScript code. In case the DOM is built in pure browser

Re: Internationalization API: LocaleList removal

2012-06-25 Thread Rick Waldron
On Mon, Jun 25, 2012 at 6:36 PM, Norbert Lindenberg ecmascr...@norbertlindenberg.com wrote: Good idea. A frozen array is more restrictive than a LocaleList (which is extensible), but that's probably OK in this context. Or we could thaw it a bit... I was thinking the same thing, but was

Re: Why not NodeList#forEach :\?

2012-06-19 Thread Rick Waldron
On Tuesday, June 19, 2012 at 8:29 AM, David Bruant wrote: Le 19/06/2012 14:11, Alex Russell a écrit : On Jun 11, 2012, at 11:46 AM, David Bruant wrote: Hi, Le 11/06/2012 12:30, Hemanth H.M a écrit : [].forEach.call(NodeList,function(elm) {}) why that? Why not treat it

Re: Internationalization: Normalization and canonical equivalence in string comparison

2012-06-19 Thread Rick Waldron
On Tue, Jun 19, 2012 at 12:36 AM, Norbert Lindenberg ecmascr...@norbertlindenberg.com wrote: The ECMAScript Internationalization API Specification currently has normalization as an optional feature in collation. However, it requires that the compare function return 0 when comparing Strings

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

2012-06-14 Thread Rick Waldron
On Thu, Jun 14, 2012 at 11:58 AM, Domenic Denicola dome...@domenicdenicola.com wrote: In our experience writing large apps, the distinction is useful. Undefined means I forgot to do something (e.g. set a property or pass an argument); null means I tried to get something but it didn't exist.

Re: ||= is much needed?

2012-06-14 Thread Rick Waldron
On Thu, Jun 14, 2012 at 2:39 PM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: snip I guess my concern is that there are significant existing subsystems where null is distinguished from undefined or where null has a specifically defined meaning that does not apply to undefined. For

Re: More fun with undefined

2012-06-14 Thread Rick Waldron
On Thu, Jun 14, 2012 at 5:35 PM, Thaddee Tyl thaddee@gmail.com wrote: On Thu, Jun 14, 2012 at 3:29 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: This is a different issue, but I wonder how badly the web would break if we made undefined a reserved word. Does anybody in JS really

Re: ||= is much needed?

2012-06-14 Thread Rick Waldron
holder and its value would be _otherwise_ undefined counts as well. And for your information, I am not w3c and I use null frequently (the same way w3c uses it). Rick Le 14/06/2012 23:16, Rick Waldron a écrit : On Thu, Jun 14, 2012 at 3:45 PM, Brendan Eich bren...@mozilla.com wrote

Re: ||= is much needed?

2012-06-12 Thread Rick Waldron
On Tue, Jun 12, 2012 at 10:33 AM, David Bruant bruan...@gmail.com wrote: Le 12/06/2012 15:27, Hemanth H.M a écrit : Would something like : obj[prop] ||= NewProp be useful? There is currently a strawman proposal for the Default Operator, which can be found here:

Re: Rest parameter syntax

2012-06-12 Thread Rick Waldron
On Tue, Jun 12, 2012 at 10:38 AM, Felix Böhm esdisc...@feedic.com wrote: Per definition, rest parameters always need to be at the end of a FormalParameterList. I was wondering if this limitation could be liftet. Consider: function foo( a, b, ...others, c ) { return [ a, b, others, c ]; }

Re: Rest parameter syntax

2012-06-12 Thread Rick Waldron
snip But I understand there are problems. First, what with optional params after ...rest. And the second, how to parse it when foo(1, 2) called? There was a lengthy thread about this, here: https://mail.mozilla.org/pipermail/es-discuss/2012-April/022256.html Rick ps. This is an

Re: ||= is much needed?

2012-06-12 Thread Rick Waldron
On Tue, Jun 12, 2012 at 11:45 AM, Ryan Florence rpflore...@gmail.comwrote: I use ||= very regularly in ruby and coffeescript, both of which have default arguments. I definitely agree that default arguments are a decent alternative. I can't recall examples where it wouldn't be enough. Do you

Re: Rest parameter syntax

2012-06-12 Thread Rick Waldron
On Tue, Jun 12, 2012 at 2:56 PM, Felix Böhm esdisc...@feedic.com wrote: Another nice place for this syntax would be destructuring: If you want to get the last elements of an array, you might want to simply use [...arr, foo, bar] = arr; I really like that syntax. And in the end, that's what

Fwd: ||= is much needed?

2012-06-12 Thread Rick Waldron
, 2012 at 11:45 AM Subject: Re: ||= is much needed? To: Rick Waldron waldron.r...@gmail.com Cc: David Bruant bruan...@gmail.com, es-discuss@mozilla.org I use ||= very regularly in ruby and coffeescript, both of which have default arguments. I definitely agree that default arguments are a decent

Re: Why not NodeList#forEach :\?

2012-06-11 Thread Rick Waldron
On Mon, Jun 11, 2012 at 9:09 AM, Tom Ellis tellis...@gmail.com wrote: ES6 draft specifies a new Array constructor called Array.from that will essentially convert array-likes into arrays This will have uses for the arguments objects too, for people that aren't using ...rest in ES6. Indeed

Re: ecmascript 6 annotated available ? EOM

2012-06-11 Thread Rick Waldron
On Mon, Jun 11, 2012 at 6:59 AM, Hemanth H.M hemanth...@gmail.com wrote: The current spec draft is available here: http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts There are several formats, with and without change notations Rick -- *'I am what I am because of who we

Re: Zed A. Shaw - The Web Will Die When OOP Dies

2012-06-11 Thread Rick Waldron
On Mon, Jun 11, 2012 at 8:54 AM, Hemanth H.M hemanth...@gmail.com wrote: snip How can one contribute ( as in code to ES or Javascript ) ? It's been my immediate, personal experience that participation itself is the best form of contribution. Be thoughtful, do research, think critically, etc.

Re: Function length

2012-06-09 Thread Rick Waldron
On Saturday, June 9, 2012 at 11:53 PM, Erik Arvidsson wrote: Don't you want to use arguments.length instead of function.length? On Jun 9, 2012 6:53 PM, Irakli Gozalishvili rfo...@gmail.com (mailto:rfo...@gmail.com) wrote: I just noticed strange behavior in spider monkey implementation of

Re: arrows and a proposed softCall

2012-06-04 Thread Rick Waldron
On Mon, Jun 4, 2012 at 6:10 PM, Yehuda Katz wyc...@gmail.com wrote: snip jQuery.each(someArray, function(i, item) { // this and item are the items in the Array // i is the index }); It's too late for jQuery to fix the order now. However, in the face of arrows or bound functions,

Re: arrows and a proposed softCall

2012-06-04 Thread Rick Waldron
On Monday, June 4, 2012 at 6:56 PM, Anton Kovalyov wrote: If I read the code correctly, it means that the same method will have different signatures depending on the function form: $(*).each(function (i, item) { … }); vs. $(*).each((item, i) = { … }) I can assure you that will

Re: New Object Extension Literal Strawman

2012-05-31 Thread Rick Waldron
On Wed, May 30, 2012 at 8:40 PM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: On May 30, 2012, at 5:14 PM, Brendan Eich wrote: Allen Wirfs-Brock wrote: I now could be quite happy with the paren based cascade idea that Brendan suggested last night. I'm surprised that no one has commented

Re: New Object Extension Literal Strawman

2012-05-31 Thread Rick Waldron
wrote: On May 30, 2012, at 2:27 PM, Rick Waldron wrote: On Wed, May 30, 2012 at 5:22 PM, David Herman dher...@mozilla.com wrote: array.{ pop(); pop(); pop(); }; path.{ moveTo(10, 10); stroke(red); fill(blue

Re: `with` revisited and related to object extension literals

2012-05-31 Thread Rick Waldron
On Thu, May 31, 2012 at 4:46 PM, T.J. Crowder t...@crowdersoftware.comwrote: On 31 May 2012 19:24, David Herman dher...@mozilla.com wrote: As I said in another thread, it's not going to happen because of the ASI hazard. Dave Expand/link? How does this cause an ASI issue (that can't be

Re: arrows and a proposed softCall

2012-05-31 Thread Rick Waldron
On Thu, May 31, 2012 at 5:40 PM, Mark S. Miller erig...@google.com wrote: snip If the predicate means what I think it should mean, I can offer some examples of when I would do this. If the predicate means anything else that's been advocated on this thread, such as fat arrow or bound, then I

Re: `with` revisited and related to object extension literals

2012-05-31 Thread Rick Waldron
Thanks Rick. For lurkers: o.{ foo() // No semi .bar() // Is this o.bar()? or .bar() on the result of foo()? }; I've been following and have read back in the thread, but I'm not seeing a how .bar() would be allowed? Point me in the right direction! Rick

Re: arrows and a proposed softCall

2012-05-31 Thread Rick Waldron
On Thu, May 31, 2012 at 7:01 PM, Mark S. Miller erig...@google.com wrote: snip // Imaginary DOM library DOM = {}; // This function accepts a function as it's second argument, // what happens when its a bound function? I'd like write the // API in a way that is friendly to both types of

Re: arrows and a proposed softCall

2012-05-31 Thread Rick Waldron
Wouldn't this mean that fat arrow functions inherit call, apply and bind as well? (I may have misunderstood this aspect) I believe they do. Yes, and both apply and call are useful on arrows, even though |this| cannot be overridden. Arguments still matter ;-). My previous

Re: arrows and a proposed softCall

2012-05-31 Thread Rick Waldron
On Thu, May 31, 2012 at 8:11 PM, Mark S. Miller erig...@google.com wrote: On Thu, May 31, 2012 at 4:55 PM, Rick Waldron waldron.r...@gmail.comwrote: Could you post a corrected example? Thanks. To reduce any confusion, I've posted the corrected code here: https://gist.github.com/2847608 Rick

Re: arrows and a proposed softCall

2012-05-31 Thread Rick Waldron
On Thursday, May 31, 2012 at 8:49 PM, Mark S. Miller wrote: On Thu, May 31, 2012 at 5:41 PM, Rick Waldron waldron.r...@gmail.com (mailto:waldron.r...@gmail.com) wrote: On Thu, May 31, 2012 at 8:11 PM, Mark S. Miller erig...@google.com (mailto:erig...@google.com) wrote

Re: arrows and a proposed softCall

2012-05-31 Thread Rick Waldron
On Thu, May 31, 2012 at 10:42 PM, David Herman dher...@mozilla.com wrote: On May 31, 2012, at 6:06 PM, Rick Waldron wrote: The original API allowed me to pass an explicitly bound callback (whether it was by bind or fat arrow) and have that binding take precendence over a default behavior

Re: arrows and a proposed softCall

2012-05-31 Thread Rick Waldron
Yes, you're exactly right - I hadn't realized this would be the behavior -- but it makes perfect sense seeing it from a different perspective. By different, I mean correct ;) Rick ___ es-discuss mailing list es-discuss@mozilla.org

Re: New Object Extension Literal Strawman

2012-05-30 Thread Rick Waldron
On Wed, May 30, 2012 at 3:46 PM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: On May 29, 2012, at 11:59 PM, Mark S. Miller wrote: ... I appreciate this reason ;), but I like semicolon for another reason -- the parens suggest factoring out the o., as if o.(stuff1; stuff2) means the

Re: New Object Extension Literal Strawman

2012-05-30 Thread Rick Waldron
On Wed, May 30, 2012 at 5:22 PM, David Herman dher...@mozilla.com wrote: On May 29, 2012, at 9:33 AM, Tab Atkins Jr. wrote: Same thoughts here. Regular devs (like me!) only see [[DefineOwnProperty]] when creating a literal, and then there's no observable distinction between these two in

Re: New Object Extension Literal Strawman

2012-05-30 Thread Rick Waldron
On Wed, May 30, 2012 at 5:22 PM, David Herman dher...@mozilla.com wrote: On May 29, 2012, at 9:33 AM, Tab Atkins Jr. wrote: Same thoughts here. Regular devs (like me!) only see [[DefineOwnProperty]] when creating a literal, and then there's no observable distinction between these two in

Re: arrows and a proposed softCall

2012-05-30 Thread Rick Waldron
On Wednesday, May 30, 2012 at 6:31 PM, David Herman wrote: On May 30, 2012, at 3:23 PM, Mark S. Miller wrote: Independent of name, I'm trying to test for might sense this. OK, but that begs the question. The problem is that your might test is neither sound (as Allen pointed out) nor

Re: New Object Extension Literal Strawman

2012-05-30 Thread Rick Waldron
On Wednesday, May 30, 2012 at 7:40 PM, Tab Atkins Jr. wrote: On Wed, May 30, 2012 at 4:34 PM, Anton Kovalyov m...@kovalyov.net wrote: I have a question. Here (https://gist.github.com/9a6d60e9c15ac4239b3d) I took a piece of existing boilerplate code and rewrote it using the new syntax.

Re: arrows and a proposed softCall

2012-05-29 Thread Rick Waldron
On Wednesday, May 30, 2012 at 12:00 AM, Russell Leggett wrote: On Tue, May 29, 2012 at 11:52 PM, John Tamplin j...@google.com (mailto:j...@google.com) wrote: On Tue, May 29, 2012 at 11:50 PM, Yehuda Katz wyc...@gmail.com (mailto:wyc...@gmail.com) wrote: I'm not sure if this makes

Re: New Object Extension Literal Strawman

2012-05-29 Thread Rick Waldron
On Wednesday, May 30, 2012 at 12:09 AM, Brendan Eich wrote: Brendan Eich wrote: The only usable+secure extensions I see are two, so we don't confuse users with almost-identical syntax with quite different (when it matters most, when under attack) semantics: A. obj.{prop: val,

Re: Generators improvement idea

2012-05-25 Thread Rick Waldron
On Fri, May 25, 2012 at 2:10 AM, François REMY fremycompany_...@yahoo.frwrote: While we're at it, I had an idea to allow to avoid the function*() {} syntax: why not yield [noLineTerminator] return ? This approach expects all future readers of my code to look deep into the function definition

Re: const classes for max/min

2012-05-24 Thread Rick Waldron
On Thursday, May 24, 2012 at 5:36 PM, Russell Leggett wrote: On Thu, May 24, 2012 at 4:50 PM, Erik Arvidsson erik.arvids...@gmail.com (mailto:erik.arvids...@gmail.com) wrote: [snip] The problems with these is that no other dynamic language has these kind of requirements. JS

TC39 meeting Wed 5/23/2012

2012-05-23 Thread Rick Waldron
# Override Mistake (Allen Wirfs-Brock, Mark Miller) AWB: - The correct people are not here for this discussion, defer to next meeting # 4.14, Unicode (Norbert Lindenderg) NL: - Regular expressions - Certain unclear, discuss with Unicode Consortium see:

Re: TC39 meeting Wed 5/23/2012

2012-05-23 Thread Rick Waldron
Thanks for filling in those blanks -Rick On Wednesday, May 23, 2012 at 7:43 PM, Brendan Eich wrote: Rick, thanks for taking these. I'll try to add a bit of explanation where it looks like you had to be there ;-). /be Rick Waldron wrote: # 4.10 Object.observe (Rafeal Weinstein

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

2012-05-23 Thread Rick Waldron
On Wednesday, May 23, 2012 at 10:08 PM, Domenic Denicola wrote: The prototyping efforts are appreciated, but can rarely be used in a comfortable way. (Compared to, say, HTML5.) I've thought a lot about how to feasibly use Harmony features in real-world code, but have fallen down every

Re: Minimal Classes as Constructors (was: Re: Classes as Cosntructors)

2012-05-22 Thread Rick Waldron
On Tue, May 22, 2012 at 3:11 PM, Herby Vojčík he...@mailbox.sk wrote: Luke Hoban wrote: In the discussion of max/min classes at the March TC39 meeting, there was support for minimal class syntax, but a couple concerns with max/min classes in particular. One category of concern is the

Re: unzip primitive and/or implicit array-of-objects to object-of-arrays in destructuring

2012-05-22 Thread Rick Waldron
On Tue, May 22, 2012 at 5:57 PM, Herhut, Stephan A stephan.a.her...@intel.com wrote: While exploring use cases for data-parallel concurrency in JavaScript using the ParallelArray API (see http://wiki.ecmascript.org/doku.php?id=strawman:data_parallelism) I found myself wanting better support

Re: String.prototype.contains and Set|Map.prototype.has naming consistency.

2012-05-20 Thread Rick Waldron
On Sunday, May 20, 2012 at 3:31 PM, Strager Neds wrote: I agree with Alle I don't see the point in adding String#contains if `str.indexOf(x) = 0` is equivalent (just like with arrays). For sets, doing something like indexOf doesn't make sense (and a large part of sets is testing for

Re: Re-throwing errors

2012-05-11 Thread Rick Waldron
On Fri, May 11, 2012 at 2:43 PM, Brendan Eich bren...@mozilla.com wrote: Domenic Denicola wrote: Consider: try { doStuff(); } catch (e) { console.log(uh oh, got an e, e); throw e; } In Node and in all browsers I've tested with, this currently loses the stack trace for `e`,

typeof null

2012-05-08 Thread Rick Waldron
Aware that that typeof null has been rejected, but I was wondering if it could be revived via the implicit opt-in path, eg: non-strict, non-opt-in: typeof null === null; // false implied opt-in: module Foo { export function create( options ) { if ( typeof options === null ) {

Re: typeof null

2012-05-08 Thread Rick Waldron
On 8 May 2012 12:19, Rick Waldron waldron.r...@gmail.com wrote: module Foo { export function create( options ) { if ( typeof options === null ) { return ... some default thing; } }; } import create from Foo; let default = create( null ); -- Wesley W. Garland

Re: typeof null

2012-05-08 Thread Rick Waldron
one frame to another, wherein the first has opted in, but the second has not, then there is breakage. Thanks Rick On 8 May 2012 12:19, Rick Waldron waldron.r...@gmail.com mailto:waldron.r...@gmail.com** wrote: module Foo { export function create( options

Re: Arrow binding

2012-04-24 Thread Rick Waldron
On Tue, Apr 24, 2012 at 12:33 PM, Tab Atkins Jr. jackalm...@gmail.comwrote: On Mon, Apr 23, 2012 at 3:36 PM, David Herman dher...@mozilla.com wrote: I'm much more sympathetic to the idea of having *two* shorter-function syntaxes, one optimized for methods and one optimized for non-method

Re: Arrow binding

2012-04-24 Thread Rick Waldron
On Tue, Apr 24, 2012 at 1:03 PM, Tab Atkins Jr. jackalm...@gmail.comwrote: On Tue, Apr 24, 2012 at 9:51 AM, Rick Waldron waldron.r...@gmail.com wrote: When I read this, I assumed it was a reference to this: http://wiki.ecmascript.org/doku.php?id=harmony:object_literals

Re: Arrow binding

2012-04-24 Thread Rick Waldron
On Tue, Apr 24, 2012 at 4:21 PM, Brendan Eich bren...@mozilla.org wrote: Rick Waldron wrote: I think the colon was just a typo Dave is not cc'ed and may have missed the responses going back to Tab's first one, but I think there was no typo. Dave's example: box = { _value: 0

Re: Shepherd.js - Implementing Harmony modules for today's browsers

2012-04-19 Thread Rick Waldron
On Thu, Apr 19, 2012 at 9:11 AM, Russell Leggett russell.legg...@gmail.comwrote: [snip] Support is coming. I look at it this way. Some day relatively soon, ES6 modules will be in node. Soon after that they will start showing up in browsers. Over the course of the next year, I bet you'll see

Re: Terminology: “non-method function”

2012-04-11 Thread Rick Waldron
On Wednesday, April 11, 2012 at 6:37 AM, Alex Russell wrote: On Apr 11, 2012, at 1:02 AM, Allen Wirfs-Brock wrote: On Apr 10, 2012, at 4:01 PM, Axel Rauschmayer wrote: What is a good term for functions that don’t have/use dynamic `this`? “Non-method function” defines them by

Re: Terminology: “non-method function”

2012-04-11 Thread Rick Waldron
On Wed, Apr 11, 2012 at 4:32 PM, Wes Garland w...@page.ca wrote: From a developer's POV - the terms bound/unbound makes a create deal of sense, since already have bind, which effectively turns an unbound function into a bound function. It basically completes the thought and makes it easy to

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

2012-04-07 Thread Rick Waldron
Hi Adam, Most of the methods that you listed are either already available in identical form or the same logic can be created with existing methods, I've noted each below On Thu, Apr 5, 2012 at 11:26 AM, Adam Shannon a...@ashannon.us wrote: Hey all, Scala has a lot of really handy functions

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

2012-04-07 Thread Rick Waldron
On Sat, Apr 7, 2012 at 8:24 PM, Erik Arvidsson erik.arvids...@gmail.comwrote: On Sat, Apr 7, 2012 at 16:40, Rick Waldron waldron.r...@gmail.com wrote: var arr = document.getElementsByTagName(a); var externalElms = arr.filter(function(acc, item) { (/^https?:\/\//).test(item.href

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

2012-04-07 Thread Rick Waldron
On Sat, Apr 7, 2012 at 8:31 PM, Erik Arvidsson erik.arvids...@gmail.comwrote: On Sat, Apr 7, 2012 at 17:28, Rick Waldron waldron.r...@gmail.com wrote: As in, its [[Class]] is Array and Array.isArray( nodes ) would evaluate to true? No, it means that Object.getPrototypeOf

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

2012-04-07 Thread Rick Waldron
On Sat, Apr 7, 2012 at 8:41 PM, Domenic Denicola dome...@domenicdenicola.com wrote: On Apr 7, 2012, at 20:37, Rick Waldron waldron.r...@gmail.com wrote: On Sat, Apr 7, 2012 at 8:31 PM, Erik Arvidsson erik.arvids...@gmail.com wrote: On Sat, Apr 7, 2012 at 17:28, Rick Waldron waldron.r

Re: arrow function syntax simplified

2012-03-30 Thread Rick Waldron
On Friday, March 30, 2012 at 6:03 AM, Marius Gundersen wrote: Indeed lexical |this| means you can't pass a wrong-this even via .call or .apply. Thanks, Isn't this a bad idea? Take for example the very common jQuery callback method, which would look like this: $(img).on(click, e =

Re: arrow function syntax simplified

2012-03-30 Thread Rick Waldron
[snip] // Or maybe change the framework to better take advantage of arrows?: $(body).on(click, e = $(e).hide()); As much as I would love this, it's not realistic. We're stuck with the unfortunate burden of supporting a consistent behaviour regardless of platform, ie jQuery will

Re: arrow function syntax simplified

2012-03-28 Thread Rick Waldron
I've been championing this syntax since Dave proposed it as the tri-lambda syntax. Through this, I've exposed many JavaScript programmers of varying experience (from fellow bocoupers to our JavaScript training sessions - overhwhelmingly actionscript or ruby devs) to the three major pieces: *Just

Re: arrow function syntax simplified

2012-03-28 Thread Rick Waldron
On Wed, Mar 28, 2012 at 3:26 PM, Kevin Smith khs4...@gmail.com wrote: - Incorrectly using return for those that don't fully understand TCP. As an illustration, consider this case: element.onclick = (evt) = do { if (this.alreadyWaitingForAjaxResponse) return;

Re: arrow function syntax simplified

2012-03-27 Thread Rick Waldron
Yes, please. This looks and feels like the proposal from Dave Herman that I supported (and enjoyed writing examples for) the most. Very exciting to see this moving along and finding wider support. Rick On Tue, Mar 27, 2012 at 4:37 PM, Axel Rauschmayer a...@rauschma.de wrote: Looks good. Not

Re: arrow function syntax simplified

2012-03-27 Thread Rick Waldron
[snip] I think fully TCP- compliant do expressions are pure win, FTR. I second this, of course, based solely on the experience I had writing up these examples: https://gist.github.com/2013909 https://github.com/rwldrn/popcorn-js/compare/tri-lambda

Re: arrow function syntax simplified

2012-03-27 Thread Rick Waldron
On Tue, Mar 27, 2012 at 7:46 PM, Luke Hoban lu...@microsoft.com wrote: Luke Hoban wrote: The do expressions serve a separate purpose of changing the meaning of return (but not break and continue) Dave proposed at https://mail.mozilla.org/pipermail/es-discuss/2012-March/021000.html

Re: arrow function syntax simplified

2012-03-27 Thread Rick Waldron
On Tuesday, March 27, 2012 at 9:54 PM, Luke Hoban wrote: But my primary point was just that in Rick's examples, there doesn't appear to be any reliance on TCP at all. Had = supported blocks on the RHS as in the original arrow proposal, all the code samples would be

Re: String.prototype.split fixed fields extension

2012-03-25 Thread Rick Waldron
I just spent some time researching TLE and it appears that no data value will ever have a space within the value itself - making a space the delimiter. Anyway, most languages include a string chunk function that returns an array. -Rick On Saturday, March 24, 2012 at 1:56 PM, Russell

Re: Finding a safety syntax for classes

2012-03-21 Thread Rick Waldron
[snip] There are likely issue with the above syntax. However, I can imagine someway saying: class Foo extends mixin(MyBase, enumerable) { } where mixin is defined as: function mixin(directSuper, ...mixins) { let effectiveSuper = class extends directSuper{ constructor(...args)

Re: value objects

2012-03-20 Thread Rick Waldron
+1 This is reminiscent of existing bignum/bigint js libs, which is nice because anyone that's used that lib will immediately get this and be able to be productive. See Also: https://github.com/substack/node-bigint On Tue, Mar 20, 2012 at 9:20 AM, Andrew Paprocki and...@ishiboo.com wrote:

Re: value objects

2012-03-20 Thread Rick Waldron
On Tue, Mar 20, 2012 at 10:26 AM, Rick Waldron waldron.r...@gmail.comwrote: +1 This is reminiscent of existing bignum/bigint js libs, which is nice because anyone that's used that lib will immediately get this sorry, s/that lib/those libs/ and be able to be productive. See Also: https

Re: Finding a safety syntax for classes

2012-03-20 Thread Rick Waldron
On Mon, Mar 19, 2012 at 4:03 PM, Russell Leggett russell.legg...@gmail.comwrote: The recent discussion “Using Object Literals as Classes” brought up some key points, but the general feeling I got and agree with is this: we need to get classes into ES6. As Kevin points out, even if it didn’t

Re: Finding a safety syntax for classes

2012-03-20 Thread Rick Waldron
On Tue, Mar 20, 2012 at 1:08 PM, Rick Waldron waldron.r...@gmail.comwrote: On Mon, Mar 19, 2012 at 4:03 PM, Russell Leggett russell.legg...@gmail.com wrote: The recent discussion “Using Object Literals as Classes” brought up some key points, but the general feeling I got and agree

Re: Finding a safety syntax for classes

2012-03-20 Thread Rick Waldron
On Tue, Mar 20, 2012 at 1:21 PM, Russell Leggett russell.legg...@gmail.comwrote: I would propose that the absolute minimal requirements would be: - has a declaration form that uses the class keyword and an identifier to create the class - has a body that can include both the

Re: Finding a safety syntax for classes

2012-03-20 Thread Rick Waldron
[ ... snip ] class Animal { constructor(name){ this.name = name; } move(meters){ alert(this.name + moved + meters + m.); } } Russ, I'm trying to write up some supporting examples, but ran into a snag regarding static properties. eg function

Re: Finding a safety syntax for classes

2012-03-20 Thread Rick Waldron
In my opinion, because it is a point of contention, there should be no special support for statics. It would be written exactly as you have it above, or you could do Sounds good to me! I've taken my previous tri-lambda-syntax support example ( https://gist.github.com/2013909) and I've

Re: Finding a safety syntax for classes

2012-03-20 Thread Rick Waldron
Another option here would be: class Snake extends Animal { // Using new ; ) new(name) : super(name) {} }; This could be visually mistaken for an object literal. Rick ___ es-discuss mailing list es-discuss@mozilla.org

Re: YAWSI: an identity unary operator

2012-03-19 Thread Rick Waldron
On Mon, Mar 19, 2012 at 5:42 PM, Peter van der Zee e...@qfox.nl wrote: 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} };

Re: Using Object Literals as Classes

2012-03-16 Thread Rick Waldron
On Fri, Mar 16, 2012 at 5:12 PM, Domenic Denicola dome...@domenicdenicola.com wrote: Just to contribute to this... er... fun-thread... My team uses the closure pattern for our classes (i.e. no prototype methods at all), since we value encapsulation. I can't imagine we're alone. For my own

Re: Using Object Literals as Classes

2012-03-16 Thread Rick Waldron
On Fri, Mar 16, 2012 at 6:04 PM, David Bruant bruan...@gmail.com wrote: Le 16/03/2012 23:00, Rick Waldron a écrit : On Fri, Mar 16, 2012 at 5:12 PM, Domenic Denicola dome...@domenicdenicola.com wrote: Just to contribute to this... er... fun-thread... My team uses the closure pattern

Re: Using Object Literals as Classes

2012-03-16 Thread Rick Waldron
On Fri, Mar 16, 2012 at 6:20 PM, Domenic Denicola dome...@domenicdenicola.com wrote: On Mar 16, 2012, at 18:12, Rick Waldron waldron.r...@gmail.com wrote: On Fri, Mar 16, 2012 at 6:04 PM, David Bruant bruan...@gmail.com wrote: Le 16/03/2012 23:00, Rick Waldron a écrit : On Fri, Mar 16

Re: Using Object Literals as Classes

2012-03-16 Thread Rick Waldron
On Mar 16, 2012, at 7:11 PM, Domenic Denicola dome...@domenicdenicola.com wrote: From: Rick Waldron [mailto:waldron.r...@gmail.com] Sent: Friday, March 16, 2012 18:40 To: Domenic Denicola Cc: David Bruant; es-discuss Subject: Re: Using Object Literals as Classes On Fri, Mar

Re: Using Object Literals as Classes

2012-03-16 Thread Rick Waldron
On Mar 16, 2012, at 7:37 PM, Domenic Denicola dome...@domenicdenicola.com wrote: From: Rick Waldron [mailto:waldron.r...@gmail.com] Sent: Friday, March 16, 2012 19:28 To: Domenic Denicola Cc: David Bruant; es-discuss Subject: Re: Using Object Literals as Classes On Mar 16, 2012

Re: UUIDs?

2012-03-15 Thread Rick Waldron
Axel, Have you ever seen this? http://www.broofa.com/2008/09/javascript-uuid-function/ I've been using this for several years Rick On Thu, Mar 1, 2012 at 5:45 PM, Axel Rauschmayer a...@rauschma.de wrote: UUIDs are useful for many tasks. One cannot create good ones in JavaScript without

Re: @name

2012-03-15 Thread Rick Waldron
Fat-arrow-only (plus do-expressions) looks like the minimal and likely winner Based on my experience with translating real world code to try out this syntax, it would be an incredible win. IIUC, it also leaves open the possibility of (params) - {} in the far future - after the world has

Re: BTF Measurements

2012-03-14 Thread Rick Waldron
On Mar 14, 2012, at 4:17 AM, Herby Vojčík he...@mailbox.sk wrote: Rick Waldron wrote: Kevin, Over the weekend I applied David Herman's new tri-lambda syntax to Popcorn.js to see how it would look and feel: https://github.com/rwldrn/popcorn-js/compare/tri-lambda Why didn't you

Re: BTF Measurements

2012-03-14 Thread Rick Waldron
On Wed, Mar 14, 2012 at 9:26 AM, Herby Vojčík he...@mailbox.sk wrote: Rick Waldron wrote: On Mar 14, 2012, at 4:17 AM, Herby Vojčíkhe...@mailbox.sk wrote: Rick Waldron wrote: Kevin, Over the weekend I applied David Herman's new tri-lambda syntax to Popcorn.js to see how it would

Question about Array.prototype.slice

2012-03-13 Thread Rick Waldron
A little different then the usual fare... When interpreting (for the sake of implementation) how the arguments of Array.prototype.slice should be handled: is it safe to assume that arguments may not be defined and that all implementations are expected to handle this the same way, as specified by

<    3   4   5   6   7   8   9   10   >