Re: Clarification on function default param values

2013-10-01 Thread Andrea Giammarchi
Just a quick one. I think the best representation in ES3 or 5 would be the following ```javascript function foo(x, y, z) { switch(arguments.length) { case 0: x = 1; case 1: y = 2; case 2: z = 3; } // whatever logic involved, i.e. return x + y + z; } ``` no break and no default

Re: Clarification on function default param values

2013-10-01 Thread Andrea Giammarchi
I see. Does `null` count as undefined too or it must be explicitly undefined ? not that using a transpiler this matters much ... just curious about how the ES < 6 will look like. On Tue, Oct 1, 2013 at 11:02 AM, Brendan Eich wrote: > No, we are using undefined actual parameter value, not argume

Re: Clarification on function default param values

2013-10-01 Thread Andrea Giammarchi
I need to read everything Brendan suggested but if anyone would be so kind to refresh my memories on this arrow function I'd appreciate that. I don't need much more than yes/no as answer, thanks. 1. `var o = {method: () => this};` will o.method() return o ? (I guess nope) Considering the follow

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

2013-10-01 Thread Andrea Giammarchi
Apologies for the off topic, I swear I thought I opened a new thread for that so here again my post. Thanks - - - - - - - - - - I need to read everything Brendan suggested but if anyone would be so kind to refresh my memories on this arrow function I'd appreciate that. I don't need much more than

Re: Clarification on function default param values

2013-10-01 Thread Andrea Giammarchi
oops, it wasn't intentional. I should have checked ... opened a new one. br On Tue, Oct 1, 2013 at 3:39 PM, Brendan Eich wrote: > Thread-hijacking is poor form. > > /be > ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/lis

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

2013-10-01 Thread Andrea Giammarchi
f JS specs available since every then we need a fat arrow to break old syntax to make the creation of self bound function easier. This would be already an answer so thanks for participating. br On Tue, Oct 1, 2013 at 3:47 PM, Tab Atkins Jr. wrote: > On Tue, Oct 1, 2013 at 3:43 PM, Andr

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

2013-10-01 Thread Andrea Giammarchi
Since every => Since ever Sent from my Windows Phone -- From: Andrea Giammarchi Sent: 10/1/2013 7:35 PM To: Tab Atkins Jr. Cc: es-discuss@mozilla.org Subject: Re: what kind of problem is this fat arrow feature trying to solve ? setTimeout accept extra argume

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

2013-10-02 Thread Andrea Giammarchi
t wrote: > Le 02/10/2013 04:35, Andrea Giammarchi a écrit : > > setTimeout accept extra arguments ... I write JavaScript that uses this >> feature. >> >> `setTimeout(callback, delay, arg1, arg2, argN, evenAnObject);` >> > What is "evenAnObject"? I

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

2013-10-02 Thread Andrea Giammarchi
could be for mostly all their DOM based tasks and why not, even more. Best Regards On Wed, Oct 2, 2013 at 10:46 AM, Tab Atkins Jr. wrote: > On Tue, Oct 1, 2013 at 7:35 PM, Andrea Giammarchi > wrote: > > setTimeout accept extra arguments ... I write JavaScript that uses this &

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

2013-10-02 Thread Andrea Giammarchi
pletely different beasts and there was my question about what is solving for the real world. No need to talk about use strict. Thanks On Wed, Oct 2, 2013 at 11:01 AM, Brendan Eich wrote: > Andrea Giammarchi wrote: > >> fat arrow does not add any capabilities but create the need to be

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

2013-10-02 Thread Andrea Giammarchi
nal way. And yes, I used more handleEvent for that reason. > > Benoit > > EOn Oct 2, 2013, at 10:55, Andrea Giammarchi > wrote: > > fat arrow does not add any capabilities but create the need to be sure > about the context. > > In use strict fat arrow will bring a lovely

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

2013-10-02 Thread Andrea Giammarchi
incoherently flattens some of my words with leading '> ' > citation prefixes. But I'll be brief here, no need to reply: > > > Andrea Giammarchi wrote: > >> In CoffeeScript the fat arrow behaves differently having a dynamic this, >> am I correct? >> >

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

2013-10-02 Thread Andrea Giammarchi
> Not only does it reduce the amount of typing, which makes it easy to fit > all these examples into a single line, it takes care of the this variable, > which is used in a lot more places than DOM event handlers. > > Marius Gundersen > > > On Wed, Oct 2, 2013 at 8:14 PM,

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

2013-10-02 Thread Andrea Giammarchi
in line On Wed, Oct 2, 2013 at 2:54 PM, David Bruant wrote: > Le 02/10/2013 19:45, Andrea Giammarchi a écrit : > > > Yes, only for these particular examples. > Tab mentioned Array extras, that's the reason I've put them in the plate. Promises ... never used the

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

2013-10-02 Thread Andrea Giammarchi
any > native dom event handlers, so your trick with the eventHandler method won't > work. And we use pubsub, which affect observables on the `this` object, and > Ajax is handled through Promises, which also needs access to the `this` > object. > > Marius Gundersen > On Oct

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

2013-10-02 Thread Andrea Giammarchi
t > bind(this) in DOM, node, etc and will replace it as previously mentioned by > the fat arrow when available. > > Regards, > > Aymeric > > Le 02/10/2013 20:11, Andrea Giammarchi a écrit : > > You need to be sure about the `this` because today you can `bind(anyObject >

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

2013-10-02 Thread Andrea Giammarchi
dan Eich wrote: > Andrea Giammarchi > <mailto:andrea.giammarchi@**gmail.com >> > >> October 2, 2013 2:25 PM >> >> Thanks. And do "we" know which one is the most common case or any reason >> we won't have the same in ES6 ? I see both options

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

2013-10-02 Thread Andrea Giammarchi
objects to > avoid adding similar APIs under a different name. > > Benoit > > On Oct 2, 2013, at 19:18, Andrea Giammarchi > wrote: > > It's a knockout choice I would say, nothing to do with the fact you cannot > have an `handleEvent` in there. > > Look at [eddy

Re: Object.mixin, why just for enumerables (?)

2013-10-03 Thread Andrea Giammarchi
this is the closest to specs we have today: https://github.com/WebReflection/object-mixin#object-mixin it does copy all own descriptors so it's suitable for almost everything you need but `Symbols` (in any case absent in ES5) That being said, it will be compatible with my `Symbol` proposal/shim/p

Re: Object.mixin, why just for enumerables (?)

2013-10-03 Thread Andrea Giammarchi
.html#sec-object.mixin > > Andrea Giammarchi wrote: > > this is the closest to specs we have today: > https://github.com/WebReflection/object-mixin#object-mixin > > it does copy all own descriptors so it's suitable for almost everything > you need but `Symbols` (in any c

Re: FYI: Ecma-404 approved and published

2013-10-08 Thread Andrea Giammarchi
looks like Douglas C. website put in PDF ... I guess that's good for backward compatibility :-) Thanks for the heads up, JSON FTW! On Tue, Oct 8, 2013 at 10:59 AM, Allen Wirfs-Brock wrote: > The Ecma General Assembly has approved by letter ballot Ecma-404: THE JSON > Data Interchange Formal > S

Re: Generic Bundling

2013-10-10 Thread Andrea Giammarchi
You are confining the problem in HTTP only scenarios while the solution provided by can be handy/reused in offline packaged applications too so HTTP 2 might win on HTTP but it's not a general HTML App packaging option. I think FirefoxOS Apps might have something similar without even bothering t

Re: Generic Bundling

2013-10-11 Thread Andrea Giammarchi
As I've said, you keep confining the problem and the solution over HTTP and servers while I see this approach, maybe slightly revisited, a good **generic bundling** solution even without a server and easily adoptable now plus this will not mean HTTP 2 won't be handy to help with this case too. The

Re: Generic Bundling

2013-10-11 Thread Andrea Giammarchi
roach proposed as standard alternative? I prefer the manifest too, for what is worth it, but if not standard, I would not consider it. Best Regards On Fri, Oct 11, 2013 at 12:02 PM, David Bruant wrote: > Le 11/10/2013 19:01, Andrea Giammarchi a écrit : > > As I've said, you

Re: Generic Bundling

2013-10-13 Thread Andrea Giammarchi
On Sat, Oct 12, 2013 at 12:07 PM, Brendan Eich wrote: > > However, Russell's counter-argument that fallback in older browsers to > loading lots of little files, request by request, from the server directory > hierarchy, may be too painful, reducing the value as a migration technique. > this is w

Re: Generic Bundling

2013-10-13 Thread Andrea Giammarchi
g-together solution (that I agreed shouldn't have been discussed here since here we talk about ECMAScript only :D) Ph well, it was good to dream for few hours :-) On Sun, Oct 13, 2013 at 5:25 AM, Brian Kardell wrote: > > On Oct 13, 2013 4:40 AM, "Andrea Giammarchi" >

Re: Generic Bundling

2013-10-13 Thread Andrea Giammarchi
ich wrote: > Jorge Chamorro wrote: > >> On 11/10/2013, at 03:53, Brendan Eich wrote: >> >>> > >>> >>>> >> On Thu, Oct 10, 2013 at 8:10 PM, Andrea Giammarchi< >>>> andrea.giammarchi@**gmail.com >>> andrea.giammarchi@*

RE: Generic Bundling

2013-10-14 Thread Andrea Giammarchi
IIRC roundtrip happens once per domain so your math is a bit off. However, I've solved that using a single js Object with all modules packed as strings and parsed at require time once to avoid huge overhead by parsing everything at once. The name is require-client and once gzipped gives similar adv

Re: Generic Bundling

2013-10-14 Thread Andrea Giammarchi
the module, if interested: https://github.com/WebReflection/require_client#require_client Best Regards On Mon, Oct 14, 2013 at 9:47 AM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > IIRC roundtrip happens once per domain so your math is a bit off. > However, I've

Re: Readdition of __proto__

2013-10-14 Thread Andrea Giammarchi
objects where once again `{"__proto__":[]}` will behave as named property instead of prototype mutator. I hope these answers are OK and to all others, please correct me whenever you think whatever I've written is wrong. Best Regards, Andrea Giammarchi On Mon, Oct 14, 2013 at 12:

Re: Readdition of __proto__

2013-10-14 Thread Andrea Giammarchi
On Mon, Oct 14, 2013 at 1:15 PM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > Yes, it's hard to search in this mailing list but luckily not everyone in > here will tell you not to be "that guy that clearly didn't read anything > and is just annoyi

Re: Generic Bundling

2013-10-14 Thread Andrea Giammarchi
it's not multiplied 500 ... that's what I've meant :-) On Mon, Oct 14, 2013 at 1:05 PM, Jorge Chamorro wrote: > On 14/10/2013, at 18:47, Andrea Giammarchi wrote: > > > IIRC roundtrip happens once per domain so your math is a bit off. > >

Re: Readdition of __proto__

2013-10-14 Thread Andrea Giammarchi
some time for extra clarification. Cheers On Mon, Oct 14, 2013 at 1:22 PM, Brendan Eich wrote: > Andrea Giammarchi wrote: > > __Current Status__ > > > (Thanks for the dunders! :-P) > > > Instead of formalizing its form, ES6 accepted `Object.setPrototypeOf` as &g

Re: Readdition of __proto__

2013-10-14 Thread Andrea Giammarchi
this? This is just like the `delete` operator. > > The object creation case and getPrototypeOf make a lot of sense but > mutating __proto__ _after_ an object has been created sounds like a > horrible broken approach that shoots behavioral typing in the foot. > Especially when I'm

Re: Readdition of __proto__

2013-10-14 Thread Andrea Giammarchi
s On Mon, Oct 14, 2013 at 1:43 PM, Brendan Eich wrote: > Andrea Giammarchi > <mailto:andrea.giammarchi@**gmail.com >> > >> October 14, 2013 1:32 PM >> >> I meant that IIRC `obj["__proto__"]` should not invoke that Annex B >> specified getter

Re: Readdition of __proto__

2013-10-14 Thread Andrea Giammarchi
`JSON` serialization <= `JSON` parse On Mon, Oct 14, 2013 at 1:53 PM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > Then I might have confused what decided with `JSON` serialization where > `"__proto__"` will be a property and not a setter, neither a g

Re: Readdition of __proto__

2013-10-14 Thread Andrea Giammarchi
_ as the literal property name does assign (set) not a > define. > > 3. Annex B.2.2.1 defines an accessor on Object.prototype, which if > unshadowed will be got or set when used by name on objects that actually > delegate to Object.prototype. It's also delete-able (configurable), >

Re: Generic Bundling

2013-10-14 Thread Andrea Giammarchi
Inline, from the Moon On Mon, Oct 14, 2013 at 2:22 PM, Jorge Chamorro wrote: > > What I meant with round-trip latency is: once the connection has been > established I was talking about this latency, those 500ms in my example > , a network packet takes almost 250 ms to go while my 100ms per

Re: Readdition of __proto__

2013-10-14 Thread Andrea Giammarchi
wrote: > > On Oct 14, 2013, at 4:21 PM, Andrea Giammarchi wrote: > > > my last memories on the topic are these: > > > > ```javascript > > > > var obj = JSON.parse('{"__proto__":[]}'); > > obj instanceof Array; // false > > obj._

Re: Readdition of __proto__

2013-10-14 Thread Andrea Giammarchi
we are lucky enough there's no browser without a native JSON object that uses the D. Crockford polyfill ^_^ On Mon, Oct 14, 2013 at 6:20 PM, Allen Wirfs-Brock wrote: > On Oct 14, 2013, at 5:54 PM, Andrea Giammarchi wrote: > > Allen my confusion is with o4 ... what happens once you

Re: Readdition of __proto__

2013-10-14 Thread Andrea Giammarchi
an example code how it is simulating the `Object.defineProperty` Thanks anyway for clarifications. On Mon, Oct 14, 2013 at 6:43 PM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > we are lucky enough there's no browser without a native JSON object that > uses the D. Cro

Re: Readdition of __proto__

2013-10-15 Thread Andrea Giammarchi
not if you parsed that object via `JSON.parse('{"__proto__":[]}')` in this case is the equivalent of that operation through `Object.defineProperty({}, '__proto__', {enumerable: true, writable: true, configurable: true})` so that `obj.__proto__` will result into property assignment and no setter in

Re: Readdition of __proto__

2013-10-15 Thread Andrea Giammarchi
oh, that's cute :D too bad I cannot shim/polyfill that in my `Object.mixin` module. I would simply *red-flag* it and discourage the usage of `__proto__` everywhere is possible (uhm wait ... I've already done that in the past, never mind ... ) Happy `__dunder__` Everybody, Cheers On Tue, Oc

Re: Scoped binding of a method to an object

2013-10-15 Thread Andrea Giammarchi
wait ... what ? On Tue, Oct 15, 2013 at 2:00 PM, Russell Leggett wrote: > > > obj::fun(a,b) is not the same as fun(obj,a,b). Its fun.call(obj,a,b). > isn't this basically the equivalent of obj->fun then ? (yes, the other arrow that was an arrow too far) Thanks for clarification ___

Re: Scoped binding of a method to an object

2013-10-15 Thread Andrea Giammarchi
uhm, never mind, I got it now. Borrowing functions avoiding call/apply looks good. Best Regards On Tue, Oct 15, 2013 at 4:17 PM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > wait ... what ? > > > On Tue, Oct 15, 2013 at 2:00 PM, Russell Leggett < > russell.

Re: Readdition of __proto__

2013-10-16 Thread Andrea Giammarchi
yeah, if you use an alias L the footgun image comes upside down too ``` L.__proto__ = null; // later on, in ES6 L.__proto__ => () pew, pew; ``` On Tue, Oct 15, 2013 at 11:01 PM, Brendan Eich wrote: > Allen Wirfs-Brock wrote: > >> On Oct 15, 2013, at 3:19 PM, Dean Landolt wrote: >> >>>

Re: Should String.prototype.split accept variable arguments optionally?

2013-10-16 Thread Andrea Giammarchi
I stopped here On Wed, Oct 16, 2013 at 5:54 AM, Benjamin (Inglor) Gruenbaum < ing...@gmail.com> wrote: > > ``` > myString.split(/ |-|\/|\+/g); // this is no fun to read > > myString.split(" ","-","/","+"); // this is easier > myString.split([" ","-","/","+"]); // this is also easier.

Re: Should String.prototype.split accept variable arguments optionally?

2013-10-16 Thread Andrea Giammarchi
also, this is the same: `myString.split(/[ -/+]/)` maybe it's better to explain those users that knowing RegExp might bring benefits for their purpose (coding) ? On Wed, Oct 16, 2013 at 10:14 AM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > I stopped here > &

Re: Should String.prototype.split accept variable arguments optionally?

2013-10-16 Thread Andrea Giammarchi
typo: Non "highly trained professionals" should *do* simple things On Wed, Oct 16, 2013 at 11:03 AM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > How could change 12+ years of legacy be considered inexpensive ? > > Non "highly trained professionals&q

Re: Should String.prototype.split accept variable arguments optionally?

2013-10-16 Thread Andrea Giammarchi
ght ;-) (not directed to you and I am sure you got what I mean) Obviously this is just my personal opinion. Cheers On Wed, Oct 16, 2013 at 10:56 AM, Benjamin (Inglor) Gruenbaum < ing...@gmail.com> wrote: > On Wed, Oct 16, 2013 at 8:18 PM, Andrea Giammarchi < > andrea.giamma

Re: Should String.prototype.split accept variable arguments optionally?

2013-10-16 Thread Andrea Giammarchi
your array in there follow Brendan hint and create your own method. Once again, just my 2 cents On Wed, Oct 16, 2013 at 1:25 PM, Benjamin (Inglor) Gruenbaum < ing...@gmail.com> wrote: > On Wed, Oct 16, 2013 at 9:03 PM, Andrea Giammarchi < > andrea.giammar...@gmail.com> wr

Re: Should String.prototype.split accept variable arguments optionally?

2013-10-16 Thread Andrea Giammarchi
here, really). Feel free to propose a new method ;-) On Wed, Oct 16, 2013 at 1:40 PM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > It does break in many ways as also Brendan said. > > `''.split(what, ever)` > > would break > > plus > > `"so

Re: `String.prototype.symbolAt()` (improved `String.prototype.charAt()`)

2013-10-18 Thread Andrea Giammarchi
+1 for the simplified `at(symbolIndex)` I would expect '𝌆'.at(1) to fail same way 'a'.charAt(1) or 'a'.charCodeAt(1) would. I would expect '𝌆'.at(symbolIndex) to behave as `length` does based on unique symbol (unicode extra) so that everyone, except RAM and CPU, will have life easier with strings

Re: `String.prototype.symbolAt()` (improved `String.prototype.charAt()`)

2013-10-18 Thread Andrea Giammarchi
"the size of that unicode string is 1" ... meaning the **virtual** size for human eyes On Fri, Oct 18, 2013 at 10:06 AM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > +1 for the simplified `at(symbolIndex)` > > I would expect '𝌆'.at(1) to

Re: `String.prototype.symbolAt()` (improved `String.prototype.charAt()`)

2013-10-18 Thread Andrea Giammarchi
if this is true then .at(symbolIndex) should be a no-brain ? ``` var virtualLength = 0; for (var x of "💩") { virtualLength++; } // equivalent of for(var i = 0; i < virtualLength; i++) { "💩".at(i); } ``` Am I missing something ? On Fri, Oct 18, 2013 at 10:03 AM, Allen Wirfs-Brock wrote: >

Re: `String.prototype.symbolAt()` (improved `String.prototype.charAt()`)

2013-10-18 Thread Andrea Giammarchi
> On Oct 18, 2013, at 10:18 AM, Andrea Giammarchi wrote: > > if this is true then .at(symbolIndex) should be a no-brain ? > > ``` > var virtualLength = 0; > for (var x of "💩") { > virtualLength++; > } > > // equivalent of > for(var i = 0; i < virtua

Re: `String.prototype.symbolAt()` (improved `String.prototype.charAt()`)

2013-10-18 Thread Andrea Giammarchi
If I understand Allen answer looks like `Array.from(“💩&💩”).length` would do, being 3, and making the operation straight forward? Cheers On Fri, Oct 18, 2013 at 1:33 PM, Mathias Bynens wrote: > On 18 Oct 2013, at 15:12, Andrea Giammarchi > wrote: > > > so my counter-qu

Re: `String.prototype.symbolAt()` (improved `String.prototype.charAt()`)

2013-10-19 Thread Andrea Giammarchi
so it's a for/of with a break when it finds a code point? if that's the only use case I'd like to have an example of how convenient it is. I am just wondering, not saying is not useful (trying to understand when/where/why I'd like to use .at()) Thanks On Fri, Oct 18, 2013 at 10:12 PM, Mathias By

Re: Object.assign and __proto__ property

2013-10-19 Thread Andrea Giammarchi
here again dunder keyword ^_^ As it is Object.assign does not bring any benefit over ```javascript for(var key in source) { target[key] = source[key]; } ``` except former pattern can easily filter undesired properties such ```javascript for(var key in source) { if (key != '__proto__') {

Re: `String.prototype.symbolAt()` (improved `String.prototype.charAt()`)

2013-10-19 Thread Andrea Giammarchi
AFAIK that's also what Allen said didn't want to implement in core. An expensive operation per each invocation due stateless loop over arbitrary indexes. Although, strings are immutable in JS so I'd implement that logic creating a snapshot once and use that as if it was an Array ... something like

Re: `String.prototype.symbolAt()` (improved `String.prototype.charAt()`)

2013-10-19 Thread Andrea Giammarchi
example mroe readable and with some typo fixed in github: https://gist.github.com/WebReflection/7059536 license wtfpl v2 http://www.wtfpl.net/txt/copying/ Cheers On Sat, Oct 19, 2013 at 11:18 AM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > AFAIK that's also w

Re: `String.prototype.symbolAt()` (improved `String.prototype.charAt()`)

2013-10-19 Thread Andrea Giammarchi
a nested loop might be a concrete case where `O(n)` happens ... not so common with strings but quite possibly used in many parsers implemented in JS itself. On Sat, Oct 19, 2013 at 12:11 PM, Brendan Eich wrote: > Allen Wirfs-Brock wrote: > >> The use case that we don't support well is any sort

Re: Promises and Decidability in Asynchronous Error Handling

2013-10-21 Thread Andrea Giammarchi
wouldn't events better suit and better solve the problem ? fetchUri("http://someauthority.com/";).on('load', response => { repsonse.heders() }); at least this is how it works in eddy.js and I've never had silent errors in current specs would be an addEventListener() within the XHR object On

Re: Promises and Decidability in Asynchronous Error Handling

2013-10-21 Thread Andrea Giammarchi
Kevin I have no idea which library you are using but if you do this: ``` fetchUri("http://someauthority.com/";).then(response => { for (let header of repsonse.heders) // Note the misspelling! console.log(header.key, header.value); }).then(Object, function error(e) {

Re: Object.assign and __proto__ property

2013-10-21 Thread Andrea Giammarchi
As sanity/integrity check, `Object.assign` should be something like this to me ... ```javascript for (var property in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (key in target) { Object.defineProperty( target, key, Object.getOwnPropertyDescri

Re: Object.assign and __proto__ property

2013-10-21 Thread Andrea Giammarchi
just one thought on this ... On Mon, Oct 21, 2013 at 8:34 PM, Rick Waldron wrote: > > > It may be beneficial, in the long run, to make it painful to use > __proto__. > proto made IE life painful until now and TC39 decided to leave it in specs ... IE11 had to adopt it to not be left behind 'cause

Re: Generic Bundling

2013-10-25 Thread Andrea Giammarchi
Ilya ... just to re-clarify what was the discussion about: Generic Bundling ... not HTTP Bundling. I don't know why many keep coupling and confining HTML5 over HTTP and nothing else. Bundling as you do with executables or apps, bundling as you send a single file update for your customer to replac

Re: Generic Bundling

2013-10-26 Thread Andrea Giammarchi
other programming langauge has one and working without HTTP in the middle? Without servers? Without an internet connection ? Thanks On Fri, Oct 25, 2013 at 8:39 PM, Ilya Grigorik wrote: > On Fri, Oct 25, 2013 at 12:17 AM, Andrea Giammarchi < > andrea.giammar...@gmail.com> wrote: > &g

Re: Generic Bundling

2013-10-26 Thread Andrea Giammarchi
belongs to es-discuss? Did I miss > something? > > > > *De :* Andrea Giammarchi > *Envoyé :* samedi 26 octobre 2013 22:15 > *À :* 'Ilya Grigorik' > *Cc :* es-discuss > > Is it possible to not put HTTP in the middle of your thoughts? > > Why is **n

Re: ES6 draft, Rev20 is now available

2013-10-30 Thread Andrea Giammarchi
This is promoting a fix in the `Object.prototype` ... and since I believe those dark days where `Object.prototype` shouldn't be touched due for/in loops, I like it ^_^ Or maybe it's just a matter of `Arguments.prototype` , the most common non iterable always converted via slice? On Wed, Oct 30,

Re: ES6 draft, Rev20 is now available

2013-10-30 Thread Andrea Giammarchi
* are gone On Wed, Oct 30, 2013 at 11:00 AM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > This is promoting a fix in the `Object.prototype` ... and since I believe > those dark days where `Object.prototype` shouldn't be touched due for/in > loops, I like it ^

Re: Cross-global instanceof

2013-10-31 Thread Andrea Giammarchi
I think the question is legit and this is a weak check `'throw' in possibleGenerator` specially if you have Dictionary like objects around ... 'length' in object does not tell you much, does it? `Object.prototype.toString` is abused all over client/server libraries/utilities since ducks sometim

Re: Cross-global instanceof

2013-10-31 Thread Andrea Giammarchi
master/src/circular-json.js#L108 Just one case, still `instanceof` is used a lot and usually for good reasons, not because we are all bad developers (I hope ...) Cheers On Thu, Oct 31, 2013 at 2:32 PM, Allen Wirfs-Brock wrote: > > On Oct 31, 2013, at 1:58 PM, Andrea Giammarchi wrote:

Re: Cross-global instanceof

2013-10-31 Thread Andrea Giammarchi
irfs-Brock wrote: > > On Oct 31, 2013, at 2:56 PM, Andrea Giammarchi wrote: > > Sorry, secure was actually "reliable", as being secure about the type, not > about security itself. > > A case where I do use instanceof is, example, with new String to easily > decide late

Re: Cross-global instanceof

2013-10-31 Thread Andrea Giammarchi
e: > > On Nov 1, 2013, at 2:46 PM, Andrea Giammarchi > wrote: > > > Allen, in which place on current known universe, when you parse a > JSON.string, your reviver function receives objects from another realm, > exactly? > Please try to keep the discourse polite.

Re: Cross-global instanceof

2013-10-31 Thread Andrea Giammarchi
2013 at 11:07 PM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > Sure, so Allen asked me a real case to show, and I've done it. Now you > please show me a real case when you pass a revival function to `JSON.parse` > that is from another realm, explaining why, as I

Re: Cross-global instanceof

2013-11-01 Thread Andrea Giammarchi
I have no idea who is doing that and why but yes, in that case I would never have used instanceof so my example is still valid as use case itself. Cheers On Thu, Oct 31, 2013 at 11:54 PM, Oliver Hunt wrote: > > On Nov 1, 2013, at 7:23 PM, Andrea Giammarchi > wrote: > > als

Re: Cross-global instanceof

2013-11-01 Thread Andrea Giammarchi
Allen I think we all agree duck typing is more flexible, powerful, easy, etc etc ... but since you mentioned, how would do distinguish between a `Map` and a `WeakMap` without passing through the branding check ? That's a very good example indeed, `'has' in obj` or `'set' in obj` does not grant you

Re: Cross-global instanceof

2013-11-01 Thread Andrea Giammarchi
Thanks Mark, so how is anyone supposed to be sure about or check a Brand in ES6 then? On Fri, Nov 1, 2013 at 1:00 PM, Mark S. Miller wrote: > > > > On Fri, Nov 1, 2013 at 12:16 PM, Andrea Giammarchi < > andrea.giammar...@gmail.com> wrote: > >> Allen I think we

Re: an idea for replacing arguments.length

2013-11-10 Thread Andrea Giammarchi
I would rather think about a smart syntax able to tell the function it should expose arguments as it was before. `function splice:arguments(start, deleteCount, ...items)` or `function splice:args(start, deleteCount, ...items)` or anything different that looks reasonable ? Or maybe not useful at

Re: an idea for replacing arguments.length

2013-11-10 Thread Andrea Giammarchi
fwiw, I have few APIs that use null or undefined / void 0 as explicit action to remove an item ... an example. ```javascript function cookie(key, value) { if (arguments.length === 1) return get(key); if (value == null) return del(key); set(key, value); return value; } ``` Although I wou

Re: an idea for replacing arguments.length

2013-11-10 Thread Andrea Giammarchi
Sun, Nov 10, 2013 at 1:24 PM, David Bruant wrote: >> >>> Le 10/11/2013 22:19, Brendan Eich a écrit : >>> >>> On Nov 10, 2013, at 9:12 PM, Andrea Giammarchi < >>>>> andrea.giammar...@gmail.com> wrote: >>>>> >>>>> No

Re: an idea for replacing arguments.length

2013-11-10 Thread Andrea Giammarchi
easy as that. On Sun, Nov 10, 2013 at 2:20 PM, Oliver Hunt wrote: > > On Nov 10, 2013, at 2:12 PM, Andrea Giammarchi < > andrea.giammar...@gmail.com> wrote: > > I think I've completely missed the `undefined === absent` conversation ... > so if I have an objec

Re: an idea for replacing arguments.length

2013-11-10 Thread Andrea Giammarchi
ld have an `arguments.length === 0` unless I've misunderstood this part of the thread (which might be as well) I won't re-quote the part in any case and if I misunderstood then all good and thanks. Cheers On Sun, Nov 10, 2013 at 2:53 PM, Brendan Eich wrote: > Andrea Giammarchi wrote

Re: Typed Objects / Binary Data Polyfills

2013-11-17 Thread Andrea Giammarchi
Nice script indeed, and it would be very nice to somehow be able to flag that module for production/performance reason where slower engines in slower hardware are not penalized much if the native implementation is not in place. Something that acts almost transparently, if that makes sense at all.

Re: Typed Objects / Binary Data Polyfills

2013-11-18 Thread Andrea Giammarchi
if it's about experimenting then `with(TypedObject) {}` would do :P Any chance there will be a way to bypass most of the stuff for production? Thanks On Mon, Nov 18, 2013 at 6:58 AM, Niko Matsakis wrote: > On Sun, Nov 17, 2013 at 02:04:57PM +0100, Till Schneidereit wrote: > > The strawman at

Re: Typed Objects / Binary Data Polyfills

2013-11-18 Thread Andrea Giammarchi
a simplified version for production that does not do everything as full-specs native would do? I hope this is more clear, thanks for any answer. On Mon, Nov 18, 2013 at 12:55 PM, Niko Matsakis wrote: > On Mon, Nov 18, 2013 at 11:46:30AM -0800, Andrea Giammarchi wrote: > > if it's abo

Re: Typed Objects / Binary Data Polyfills

2013-11-18 Thread Andrea Giammarchi
or further answers, if any. On Mon, Nov 18, 2013 at 6:23 PM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > I believe one of the benefits on having Typed Objects is to have more > performant objects and collections of objects, as structs have been since > basically ever

Re: Error.name

2013-11-23 Thread Andrea Giammarchi
the way I've solved that a while ago ( https://code.google.com/p/formaldehyde/source/browse/trunk/formaldehyde.js ) `(ServerError.prototype = new Error).name = "ServerError";` Today I would do ```javascript function ServerError(message) { this.message = '' + message; } ServerError.prototype =

any toMethod() use case ?

2013-12-02 Thread Andrea Giammarchi
Reading this: http://esdiscuss.org/topic/november-19-2013-meeting-notes#content-6 I was wondering if anyone would be so kind to provide a concrete/real-world use case for toMethod() since I am having hard time to imagine a scenario where a super can be so easily invoked, being (AFAIK) multiple inh

Re: any toMethod() use case ?

2013-12-03 Thread Andrea Giammarchi
13, at 7:51 PM, Andrea Giammarchi wrote: > > Reading this: > http://esdiscuss.org/topic/november-19-2013-meeting-notes#content-6 > > I was wondering if anyone would be so kind to provide a > concrete/real-world use case for toMethod() since I am having hard time to > imagine a scen

Re: any toMethod() use case ?

2013-12-03 Thread Andrea Giammarchi
toMethod is needed/wanted/desired instead of static/explicit super.method calls. On Tue, Dec 3, 2013 at 11:07 AM, Brendan Eich wrote: > Andrea Giammarchi wrote: > >> Thanks Allen but you mentioned `Object.mixin` twice while this has been >> abandoned >> > > No, def

Re: any toMethod() use case ?

2013-12-03 Thread Andrea Giammarchi
> people have such an emotional attachment to their conception of what the > word "mixin" means and it causes reactions like this. In that sense, I'm > glad it's gone from ES6. > > > ---------- > *From:* es-discuss on behalf of Andrea &

Re: any toMethod() use case ?

2013-12-03 Thread Andrea Giammarchi
what do TypeScript folks think about this? To me it looks like I can drop the polyfill (1) until a meaningful `toMethod` exists in ES5 Reading through, I missed the part the super binding could have been redefined in any case. I still will very appreciate an example ... maybe even an abstract on

Re: any toMethod() use case ?

2013-12-03 Thread Andrea Giammarchi
ne that I don't get ... I can use toMethod for something that will simply break or not behave as expected, while what I'd like to do is to be sure that the Map method is used and nothing else. Thanks On Tue, Dec 3, 2013 at 11:56 AM, Allen Wirfs-Brock wrote: > > On Dec 3, 2013,

Re: Array.prototype[0] setter

2011-10-24 Thread Andrea Giammarchi
In webkit nightly not even the getter gets invoked. On Tue, Oct 18, 2011 at 9:31 PM, felix wrote: > If I define a setter for Array.prototype[0], does [].push invoke that > setter? > > Test code: > > > > Object.defineProperty( >Array.prototype, 0, >{ get : function() { alert('get 0');

Re: Array.prototype[0] setter

2011-10-24 Thread Andrea Giammarchi
rue, configurable : false }); a.length = 0; a.push = [].push; alert('before push a[0] = ' + a[0]); a.push(44); alert('after push a[0] = ' + a[0]); On Mon, Oct 24, 2011 at 4:12 PM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > In webkit nightly not even t

Re: Enums?

2011-10-24 Thread Andrea Giammarchi
memory/performances improved as possible for mobile. What do you think ? Best Regards, Andrea Giammarchi On Mon, Oct 24, 2011 at 8:42 PM, Axel Rauschmayer wrote: > FWIW: I’ve blogged about this. > http://www.2ality.com/2011/10/enums.html > > On Oct 3, 2011, at 19:03 , Allen

Re: Enums?

2011-10-24 Thread Andrea Giammarchi
return keys(this).map(mapSymbolValue, this); } }); // exports exports.Enum = Enum; exports.Symbol = Symbol; }(Object, typeof exports == "undefined" ? this["enum"] = {} : exports)); Best Regards, Andrea Giammarchi On Mon, Oct 24, 2011 at 11:53

Re: Enums?

2011-10-24 Thread Andrea Giammarchi
demonstrated here indeed: http://jsperf.com/array-extras-second-argument on average, closures plus scope lookup looks always slower but I'll add more tests. On Tue, Oct 25, 2011 at 12:23 AM, Brendan Eich wrote: > On Oct 24, 2011, at 2:53 PM, Axel Rauschmayer wrote: > > > that = this: > > - Your

<    4   5   6   7   8   9   10   11   12   13   >