Re: Class declarations

2012-03-16 Thread Axel Rauschmayer
just go in circles. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Class declarations

2012-03-16 Thread Axel Rauschmayer
see use-before-definition as too problematic, but there might be factors that I’m not aware of. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss

Re: Using Object Literals as Classes

2012-03-16 Thread Axel Rauschmayer
; var age = name.create(); var strength = name.create(); */ // private method @incAge() { this.@age++; } } -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: usable enough private names (was: Re: Using Object Literals as Classes)

2012-03-16 Thread Axel Rauschmayer
Denicola wrote: Yes, this looks pretty solid, although I can't remember seeing it anywhere. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https

Re: @name

2012-03-15 Thread Axel Rauschmayer
proposal over arrow syntax. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

UUIDs?

2012-03-15 Thread Axel Rauschmayer
UUIDs are useful for many tasks. One cannot create good ones in JavaScript without browsers exposing more of the underlying platform. Would it make sense to add UUID generation to ECMAScript.next? Or is that something for a browser API? Axel -- Dr. Axel Rauschmayer a...@rauschma.de home

Re: @name

2012-03-14 Thread Axel Rauschmayer
. But it does illustrate the @name concept.) -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: @name

2012-03-14 Thread Axel Rauschmayer
. Ironically, with a German keyboard, it is quicker to type this. than it is to type @. -- Dr. Axel Rauschmayer a...@rauschma.de twitter.com/rauschma Home: rauschma.de Blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https

Re: Callable values: trying to summarize

2012-03-12 Thread Axel Rauschmayer
“regular” functions much, anyway. On Mar 12, 2012, at 5:54 , Brendan Eich wrote: Axel Rauschmayer wrote: I like `use fn`, but it’s not yet clear to me how it interacts with modules (including, possibly, `use module`) use module; was withdrawn. use fn; is just a pragma to make fn

Callable values: trying to summarize

2012-03-11 Thread Axel Rauschmayer
/178792012215091200 -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Callable values: trying to summarize

2012-03-11 Thread Axel Rauschmayer
keyword, things are easier to parse. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Callable values: trying to summarize

2012-03-11 Thread Axel Rauschmayer
Not at all. If anything, I have a slight preference for the traditional solution. On Mar 11, 2012, at 14:52 , François REMY wrote: Stunned to read that from someone asking for the arrow syntax, but yes, it’s right. From: Axel Rauschmayer Sent: Sunday, March 11, 2012 2:46 PM

Re: Callable values: trying to summarize

2012-03-11 Thread Axel Rauschmayer
to be an orthogonal feature. On Mar 12, 2012, at 4:48 , Allen Wirfs-Brock wrote: see https://gist.github.com/2015544 for my current thougthts -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: optional function keyword

2012-03-08 Thread Axel Rauschmayer
about 'arguments'? Just say no. /be ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: How about replacing | with -

2012-03-04 Thread Axel Rauschmayer
to learn a new symbol (eg |) or a new keyword (eg beget)? Long term, does it make any cognitive difference? Allen ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss -- Dr. Axel Rauschmayer

Re: How about replacing | with -

2012-03-04 Thread Axel Rauschmayer
, does it make any cognitive difference? Allen ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog

Private name objects and monkey patching

2012-03-04 Thread Axel Rauschmayer
named property help with monkey-patching? If there are several of them, it would be impossible to guess which is which. Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss

Re: How about replacing | with -

2012-03-03 Thread Axel Rauschmayer
since the [[Prototype]] property is a reference): let sub = sup + {p:1, q:2}; (E4X ambiguity, no worries.) Comments? -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss

Re: How about replacing | with -

2012-03-03 Thread Axel Rauschmayer
-object of”. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: How about replacing | with -

2012-03-03 Thread Axel Rauschmayer
for intermediate lhs operands. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: How about replacing | with -

2012-03-03 Thread Axel Rauschmayer
OK, forget that. You could still produce left-hand sides... On Mar 3, 2012, at 17:57 , Axel Rauschmayer wrote: Speaking of compositions though, I can't recall if it was ever discussed whether this operator can be chained, and if so, whether it associates. I don't see too much value

Re: How about replacing | with -

2012-03-02 Thread Axel Rauschmayer
list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https

Re: How about replacing | with -

2012-03-02 Thread Axel Rauschmayer
: MyObject.prototype - {a:1,b:2} appArrayBehavior-[0,1,2,3,4,5] let subclass = superclass - function () {}; var p = newRegExpMethods - /[a-m][3-7]/ What do you think? Do you like - better than | ? Is it ok to not have it available for some possible future function shorthand? -- Dr. Axel

Re: How about replacing | with -

2012-03-02 Thread Axel Rauschmayer
design be committee – Fred Brooks argues that good design is best decided by a single person (two, if one of them is dominant). A TC39 vote? A BDFL decree? -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Sugar for *.prototype and for calling methods as functions

2012-02-21 Thread Axel Rauschmayer
of programming. Let me know what do you think about that. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo

Re: Sugar for *.prototype and for calling methods as functions

2012-02-21 Thread Axel Rauschmayer
them. Beautiful, no more constructors-as-poor-man’s-namespaces. All generic methods could be in such modules, with uncurried `this`. But, with generic methods I’m undecided, they also make sense as “static” methods: http://wiki.ecmascript.org/doku.php?id=strawman:array_statics -- Dr. Axel

Re: New full Unicode for ES6 idea

2012-02-19 Thread Axel Rauschmayer
it be a switch for all breaking ES.next changes? -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: New full Unicode for ES6 idea

2012-02-19 Thread Axel Rauschmayer
(1JS), both approaches can be tested in the wild. I’m mostly sold on 1JS, but a few doubts remain, trying out the BRS clean cut solution for Unicode will either allay or confirm those doubts. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog

ECMA-262, 9.5: Why the name “posInt”?

2012-02-18 Thread Axel Rauschmayer
Quote: “Let posInt be sign(number) * floor(abs(number)).” Why is this variable called “posInt”? It can’t be an abbreviation for “positive integer”, because it can be negative(?) -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Set iterators

2012-02-14 Thread Axel Rauschmayer
https://mail.mozilla.org/listinfo/es-discuss -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Set constructor arguments

2012-02-13 Thread Axel Rauschmayer
(and introduce another version of the horror that is the Array constructor). With the existence of the spread operator I think that there's a good argument in favour of the multiple parameters approach. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma

Re: Set constructor arguments

2012-02-13 Thread Axel Rauschmayer
functions the constructor is a factory itself and no need to new my 2 cents, br On Mon, Feb 13, 2012 at 10:01 AM, Axel Rauschmayer a...@rauschma.de wrote: My suspicion: All these features make sense for the full-blown collections API, but for sets I’m not sure at which point

Re: __proto__ security

2012-02-12 Thread Axel Rauschmayer
__proto__ is used by Zepto.js and other mobile frameworks. Is it mainly used to create array instances? Would it make sense to push for Array.create() as quickly as possible, as a shim-able alternative (using __proto__ on some browsers, being native on others)? -- Dr. Axel Rauschmayer

Re: Read access to [[Class]]?

2012-01-28 Thread Axel Rauschmayer
: $ Object.prototype.toString.call(true) '[primitive boolean]' -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org

Re: The global object should not be the global scope instance object

2012-01-27 Thread Axel Rauschmayer
interdependencies cases. Is STL the simplest solution for users? /be ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma

Re: Two kinds of [] (was: Re: shortcuts for defining block-local private names, plays nicely with @foo syntax)

2012-01-27 Thread Axel Rauschmayer
and Object.setProperty that Allen referred to on the object model reformation wiki page) Cheers, Tom -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es

Firefox/Chrome: {} + {} etc.

2012-01-27 Thread Axel Rauschmayer
-- [16:35:38.002] [] + {} [16:35:38.004] [object Object] // OK Node.js is better: $ {} + {} '[object Object][object Object]' $ {} + [] '[object Object]' Oddly, Chrome returns the same results as Firefox (different version of V8?) -- Dr. Axel Rauschmayer a...@rauschma.de

Re: Firefox/Chrome: {} + {} etc.

2012-01-27 Thread Axel Rauschmayer
block statement. On Fri, Jan 27, 2012 at 9:47 AM, Axel Rauschmayer a...@rauschma.de wrote: If I read ECMA-262 right then I would expect + to do the following if its operands are either {} or []: - Convert each operand to a primitive via ToPrimitive() - To do so, first try valueOf() (which

Read access to [[Class]]?

2012-01-27 Thread Axel Rauschmayer
I would still love to get read access to the [[Class]] property in ES.next. Proposal: A function getTypeName(). - Primitives p: return typeof p (except: null for null) - Objects o (including functions): return o.[[Class]] Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de

Re: Firefox/Chrome: {} + {} etc.

2012-01-27 Thread Axel Rauschmayer
outside of a REPL. Try this variant function f() { {;} + {} } to more clearly see what is being parsed. What works for me is closing my left eye. ;-) http://www.youtube.com/watch?v=46btEgKmCTo -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog

Re: shortcuts for defining block-local private names, plays nicely with @foo syntax

2012-01-25 Thread Axel Rauschmayer
a method such as Array.isArrayLike(), but that might be jumping the gun and best delayed until there are contracts or something similar. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es

Re: shortcuts for defining block-local private names, plays nicely with @foo syntax

2012-01-24 Thread Axel Rauschmayer
named elementGet/elementSet methods. @() could take the place of [] for property access, if we allow string operands. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list

Re: shortcuts for defining block-local private names, plays nicely with @foo syntax

2012-01-24 Thread Axel Rauschmayer
that using something else is a must, IMHO. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: shortcuts for defining block-local private names, plays nicely with @foo syntax

2012-01-23 Thread Axel Rauschmayer
) { } To me, consistency is much more important than saving characters. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https

Re: shortcuts for defining block-local private names, plays nicely with @foo syntax

2012-01-23 Thread Axel Rauschmayer
liked the explicit `this`, especially compared to Java). -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es

Re: shortcuts for defining block-local private names, plays nicely with @foo syntax

2012-01-23 Thread Axel Rauschmayer
before lines like this. Consciously? Sight. Right. Not a good idea, then. An important consideration is that eliminating `this` will increase the grawlix-factor of JavaScript (I always liked the explicit `this`, especially compared to Java). -- Dr. Axel Rauschmayer a...@rauschma.de

Re: shortcuts for defining block-local private names, plays nicely with @foo syntax

2012-01-23 Thread Axel Rauschmayer
will be. Object.getProperty(key) might be enough. [1] http://wiki.ecmascript.org/doku.php?id=strawman:object_model_reformation [2] http://www.2ality.com/2012/01/roles-objects-arrays.html -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Two kinds of [] (was: Re: shortcuts for defining block-local private names, plays nicely with @foo syntax)

2012-01-23 Thread Axel Rauschmayer
implementations). For the few remaining cases, Object.getProperty() (or something similar) should do just fine. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es

Re: shortcuts for defining block-local private names, plays nicely with @foo syntax

2012-01-23 Thread Axel Rauschmayer
? -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Block lambda is cool, its syntax isn't

2012-01-21 Thread Axel Rauschmayer
. Extension names are the constructors of the Extension type. http://hackage.haskell.org/packages/archive/Cabal/1.6.0.3/doc/html/Language-Haskell-Extension.html -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Fixing instanceof (Array.isArray() etc.)?

2012-01-21 Thread Axel Rauschmayer
-- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: January 19 meeting notes

2012-01-20 Thread Axel Rauschmayer
() { m.add(alerts[i]) }, (i+1) * 10); }(i)); } -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es

Fixing instanceof (Array.isArray() etc.)?

2012-01-20 Thread Axel Rauschmayer
version of instanceof might help (as opposed to Function.isFunction, Date.isDate, RegExp.isRegexp etc.). -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss

Re: Block lambda is cool, its syntax isn't

2012-01-20 Thread Axel Rauschmayer
(which has been mentioned many times)? It seems very appropriate and is even easy to type on a Mac (easier than square brackets on a German keyboard!). -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Block lambda is cool, its syntax isn't

2012-01-20 Thread Axel Rauschmayer
): - Poll people for their opinion - Search JS code bases for how often the identifier fn is used (how?). -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss

Re: Block lambda is cool, its syntax isn't

2012-01-19 Thread Axel Rauschmayer
On Jan 19, 2012, at 8:27 , Brendan Eich wrote: To fix (2), how about reviving arrows and avoiding the non-LR(1) parsing for grammar validation problem? Couldn’t one always freeze such a function shorthand and then get syntax such as: #(x, y) { x + y } -- Dr. Axel Rauschmayer

Re: Block lambda is cool, its syntax isn't

2012-01-19 Thread Axel Rauschmayer
by default be OK for 98% of the cases? If you want anything else, you can use a traditional function. Then the above syntax as the only function shorthand would be OK. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Block lambda is cool, its syntax isn't

2012-01-19 Thread Axel Rauschmayer
the rejected syntaxes (= less running in circles) – simply copying emails (such as yours below) there would probably suffice. On Jan 19, 2012, at 20:27 , Brendan Eich wrote: Axel Rauschmayer mailto:a...@rauschma.de January 19, 2012 9:31 AM Rationale: wouldn’t freezing by default be OK for 98

Re: January 19 meeting notes

2012-01-19 Thread Axel Rauschmayer
of the binding is the terminating loop control. Yay (I'm pretty sure). -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https

Re: January 19 meeting notes

2012-01-19 Thread Axel Rauschmayer
and sharing still being available makes it look like the right decision. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org

Re: ES6 Collections Polyfill

2012-01-18 Thread Axel Rauschmayer
Nice! Related: https://github.com/paulmillr/es6-shim On Jan 18, 2012, at 8:54 , Andrea Giammarchi wrote: Somebody may be interested into ES6 Map, WeakMap, and Set Here my attempt with all explanations: https://github.com/WebReflection/es6-collections -- Dr. Axel Rauschmayer a...@rauschma.de

Re: A different semantics for WeakMap#get default value

2012-01-18 Thread Axel Rauschmayer
separation of concerns. This would solve all of the use cases that I have had so far. == Typo: defaulValue -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss

Re: ES6 “modes” and user-friendliness

2012-01-17 Thread Axel Rauschmayer
a superset of #2 = subsuming it), but using module as a switch, distinguishing #1 and #2 might be worth it. [1] https://mail.mozilla.org/pipermail/es-discuss/2012-January/019195.html -- Dr. Axel Rauschmayer a...@rauschma.de twitter.com/rauschma Home: rauschma.de Blog: 2ality.com

Re: ES6 “modes” and user-friendliness

2012-01-17 Thread Axel Rauschmayer
that are not backward-compatible with with ES5.strict” (if those exist, but it seems like they do). -- Dr. Axel Rauschmayer a...@rauschma.de twitter.com/rauschma Home: rauschma.de Blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https

Re: ES6 “modes” and user-friendliness

2012-01-17 Thread Axel Rauschmayer
it is a useful feature independent of the language cleanups in carries with it, and because it doesn't require a noisy opt-in pragma. So the language has 3 modes in the spec, but in practice only 2 that matter. Crystal clear now, thanks! -- Dr. Axel Rauschmayer a...@rauschma.de twitter.com

Re: Block Lambdas: break and continue

2012-01-17 Thread Axel Rauschmayer
such as do: seem an obvious choice. -- Dr. Axel Rauschmayer a...@rauschma.de twitter.com/rauschma Home: rauschma.de Blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: ES6 “modes” and user-friendliness

2012-01-17 Thread Axel Rauschmayer
introduce breaking changes? That might be something worth planning for. Presumably modules will make it easier to encapsulate this kind of change. -- Dr. Axel Rauschmayer a...@rauschma.de twitter.com/rauschma Home: rauschma.de Blog: 2ality.com ___ es

Re: Unblocking sleep semantics

2012-01-17 Thread Axel Rauschmayer
;` special form would be spelled spelled `yield` instead, and as shallow continuations this style avoids the potential interleaving hazards implied by your proposal (the inherent run-to-completion violation of fibers). [1] https://github.com/mozilla/task.js -- Dr. Axel Rauschmayer a...@rauschma.de

Re: ES6 opt-in, reloaded

2012-01-16 Thread Axel Rauschmayer
it (yet). Claus Reinke’s recount of lessons learned by the Haskell community in this area also seems relevant: https://mail.mozilla.org/pipermail/es-discuss/2012-January/019396.html Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Harmony modules feedback

2012-01-16 Thread Axel Rauschmayer
see if we can identify a translation between well chosen subsets of AMD and ES.next modules. But even if no good automatic translation is found, code written to AMD will be more easily ported to ES.next modules than code written by current web practices. +1 -- Dr. Axel Rauschmayer

Re: Block Lambdas: break and continue

2012-01-16 Thread Axel Rauschmayer
; //[no LineTerminator here] before with ... } }; +1 It might make sense to also introduce an “unlabeled” break-with that exits from the current (unlabeled) block. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Harmony modules feedback

2012-01-16 Thread Axel Rauschmayer
@Andrea, Mariusz: Are you aware of the RequireJS optimizer [1]? It can be used together with almond [2], an AMD loader with minimal footprint. [1] http://requirejs.org/docs/optimization.html [2] https://github.com/jrburke/almond -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de

Re: A different semantics for WeakMap#get default value

2012-01-16 Thread Axel Rauschmayer
map values, so I wouldn't be affected. Has anyone else experience in storing falsy values? David ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss -- Dr. Axel Rauschmayer a...@rauschma.de home

Re: A different semantics for WeakMap#get default value

2012-01-16 Thread Axel Rauschmayer
. The return statement returns the value that is there if the key existed in the map or the default value (which has just been assigned). David -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es

Re: A different semantics for WeakMap#get default value

2012-01-16 Thread Axel Rauschmayer
to be stored? Axel, does this add enough value to expand the API by 25%? -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org

Re: A different semantics for WeakMap#get default value

2012-01-16 Thread Axel Rauschmayer
names. Furthermore, trailing callable parameters are often self-explanatory. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https

ES6 “modes” and user-friendliness

2012-01-16 Thread Axel Rauschmayer
semantics with some ES6 features. When would that matter (except while developing ES6)? -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https

Re: Block Lambdas: break and continue

2012-01-15 Thread Axel Rauschmayer
). Then it should become clear where/if people miss break and continue. A label is a reasonable work-around that should even survive the insertion of a “loop-ifying” keyword. Could we call block lambdas just lambdas? The former seems a bit pleonastic. -- Dr. Axel Rauschmayer a...@rauschma.de

Re: Block Lambdas: break and continue

2012-01-14 Thread Axel Rauschmayer
think it’s a must-have, but whenever you catch exceptions, you have similar issues. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https

Re: Block Lambdas: break and continue

2012-01-14 Thread Axel Rauschmayer
responsibility, any more. `continue` as an early return seems less important, because you can use break as follows: mycoll.forEach { | x | block: { if (x 0) { break block; // continue } // do more with x here } } -- Dr. Axel

Re: Block lambda grammar: BlockArguments

2012-01-14 Thread Axel Rauschmayer
idea. With a normal paren call, I don’t see any problems. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es

Re: Block lambda grammar: BlockArguments

2012-01-14 Thread Axel Rauschmayer
expect a function or method call when they see a parenthesized value. The following seems like an elegant and easy to understand rule to me: “The parameters of a function or method call are either parenthesized or paren-free. In the latter case, all parameters must be lambdas.” -- Dr. Axel

Re: Block lambda grammar: BlockArguments

2012-01-14 Thread Axel Rauschmayer
Cool. I also have a feeling that every paren-free lambda after the first one should have some kind of preceding keyword or name, but I don’t know how one could make that happen. Brace-free object literals? (only half joking)On Jan 15, 2012, at 3:42 , Brendan Eich wrote: Brendan Eich

Re: Block Lambdas: break and continue

2012-01-13 Thread Axel Rauschmayer
I think it’s a valid concern. The idea is: If I can implement my own loops (the nice-looking paren-free syntax feeds that illusion!) then I also want those loops to have break and continue. You could statically determine what construct, say, a break applies to and either throw a BreakException (if

Re: Block lambda grammar: BlockArguments

2012-01-13 Thread Axel Rauschmayer
would rather achieve this effect without currying. Following a block with a non-block doesn’t seem like a good idea. Has the other approach been considered? -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Harmony modules feedback

2012-01-12 Thread Axel Rauschmayer
of it ties into my comments on ECMAScript, so I think it is best to leave it in the blog post vs. reproducing here. Also, I do not expect answers to my questions right away, just throwing out things that would be nice to have answered as part of the final design. -- Dr. Axel Rauschmayer

Re: Octal literals have their uses (you Unix haters skip this one)

2012-01-12 Thread Axel Rauschmayer
for supporting octal literals in strict mode. /be ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Octal literals have their uses (you Unix haters skip this one)

2012-01-12 Thread Axel Rauschmayer
-decimal literals, for example: 0b1011, 0o732 and 0x. For long literals, Java has started to make _ as a separator legal, that would be nice to have, too: let aLotOfMoney = 120_327_756_228; -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog

Re: ES6 doesn't need opt-in

2012-01-07 Thread Axel Rauschmayer
On Jan 7, 2012, at 23:22 , Claus Reinke wrote: But the new plan reminds me strongly of bad experiences in Haskell-land. That sounds interesting. Is this documented somewhere? -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: ES6 doesn't need opt-in

2012-01-07 Thread Axel Rauschmayer
ES6-only (=ES6-differs-from-ES5.nonstrict) This might be about to the question as to whether there should be a mode that combines ES6-differs-from-ES5.strict constructs with ES5.nonstrict. I don’t think there should be. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter

Re: ES6 doesn't need opt-in

2012-01-06 Thread Axel Rauschmayer
the understanding of the code that I had so far. I like the whole-file-or-nothing approach for switching semantics that you proposed. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss

Re: ES6 doesn't need opt-in

2012-01-06 Thread Axel Rauschmayer
in both ES5 and ES6, but differing semantics.”) -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: ES6 doesn't need opt-in

2012-01-06 Thread Axel Rauschmayer
world” and then only have two labels. There are two ways out of this world: - Non-ES6 environments for implementors: refer to ECMA-262 version 5.1. - Non-ES6 environments for developers: simulate ES6 (via static compilation, dynamic compilation, etc.). -- Dr. Axel Rauschmayer a...@rauschma.de

Re: ES6 doesn't need opt-in

2012-01-06 Thread Axel Rauschmayer
and ES5.strict on the other hand. But it makes sense that even if developers (engine users) are presented with something simple, implementors have to take care of many more details. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Improving Function.prototype.bind

2012-01-05 Thread Axel Rauschmayer
is carried over to data structures), but not the same reference. It’s a shame that we are really close in JavaScript, with the ECMA-262 specification using references. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Improving Function.prototype.bind

2012-01-05 Thread Axel Rauschmayer
that would not solve much 'cause you can bind a function to a single object and no more. Isn’t that the most frequent use case? Do you have examples where you bind the same function to several objects? -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma

Re: ES6 doesn't need opt-in

2012-01-05 Thread Axel Rauschmayer
, JavaScript additionally faces the challenge that a developer can’t control what language version is implemented by the browser. How will that be handled? Sketching a solution would provide a more complete picture of how to migrate to ES6. -- Dr. Axel Rauschmayer a...@rauschma.de home

Re: Improving Function.prototype.bind

2012-01-05 Thread Axel Rauschmayer
into ES.next is diverse (E, Racket, Smalltalk, etc.). Lastly, progress is steady and if ES.next is finished by 2013 then that is quite impressive. Compare: five years between Java 6 – with few new features – and Java 7. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com

Re: Improving Function.prototype.bind

2012-01-05 Thread Axel Rauschmayer
to bind() a method. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: ES6 doesn't need opt-in

2012-01-04 Thread Axel Rauschmayer
or client-side, possibly including caching)? This multi-version scheme could even be applied to (the JS code embedded in) HTML files. Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es

<    2   3   4   5   6   7   8   9   10   11   >