Re: Iteration of the Arguments object

2013-10-26 Thread Jason Orendorff
The minutes from the November 29, 2012 meeting http://esdiscuss.org/notes/2012-11-29 say: Conclusion/Resolution Add iterator protocol to arguments object (should exist on all things. Array.from: 1. Iterator protocol 2. Array-Like for-of spread: 1. Iterator protocol -j

Re: Working with grapheme clusters

2013-10-26 Thread Norbert Lindenberg
The internationalization working group is planning to support grapheme clusters through its text segmentation API - the strawman: http://wiki.ecmascript.org/doku.php?id=globalization:text_segmentation Note that Unicode Standard Annex #29 allows for tailored (language sensitive) grapheme

Re: Working with grapheme clusters

2013-10-26 Thread Norbert Lindenberg
On Oct 24, 2013, at 7:38 , Anne van Kesteren ann...@annevk.nl wrote: On Thu, Oct 24, 2013 at 3:31 PM, Mathias Bynens math...@qiwi.be wrote: Imagine you’re writing a JavaScript library that escapes a given string as an HTML character reference, or as a CSS identifier, or anything else. In

Re: Working with grapheme clusters

2013-10-26 Thread Norbert Lindenberg
On Oct 25, 2013, at 18:35 , Jason Orendorff jason.orendo...@gmail.com wrote: UTF-16 is designed so that you can search based on code units alone, without computing boundaries. RegExp searches fall in this category. Not if the RegExp is case insensitive, or uses a character class, or ., or a

Re: Working with grapheme clusters

2013-10-26 Thread Bjoern Hoehrmann
* Norbert Lindenberg wrote: On Oct 25, 2013, at 18:35 , Jason Orendorff jason.orendo...@gmail.com wrote: UTF-16 is designed so that you can search based on code units alone, without computing boundaries. RegExp searches fall in this category. Not if the RegExp is case insensitive, or uses a

RE: Generic Bundling

2013-10-26 Thread François REMY
± Because using a ZIP file is a bad practice we certainly should not ± allow. As stated before, it will make the website slow [...] ± ± It seems what you're saying is that there are already superior ways to bundle ± JS modules and we don't need W3C to define another one. ± Perhaps—but this

Re: Working with grapheme clusters

2013-10-26 Thread Jason Orendorff
On Fri, Oct 25, 2013 at 11:42 PM, Norbert Lindenberg ecmascr...@lindenbergsoftware.com wrote: On Oct 25, 2013, at 18:35 , Jason Orendorff jason.orendo...@gmail.com wrote: UTF-16 is designed so that you can search based on code units alone, without computing boundaries. RegExp searches fall in

Re: Generic Bundling

2013-10-26 Thread Sam Tobin-Hochstadt
On Sat, Oct 26, 2013 at 9:05 AM, François REMY francois.remy@outlook.com wrote: Bundling in general is not going to be a valid approach for any purpose related to efficiency soon (except maybe archive-level compression where grouping similar files may improve compression rate slightly).

Object.create() VS functions

2013-10-26 Thread Michaël Rouges
Bonjour à tous, `Knowing that every function is an object, I am surprised that the Object.create() method doesn't really allow cloning function. So I made ​​an implementation as follows: `Object.create = (function () { 'use strict'; var slice, curry,

Re: Object.create() VS functions

2013-10-26 Thread Brandon Benvie
On 10/26/2013 7:44 AM, Michaël Rouges wrote: Knowing that every function is an object, I am surprised that the Object.create() method doesn't really allow cloning function. Object.create creates Objects. You run into the same limitation when trying to create Arrays with Object.create (doesn't

Re: Working with grapheme clusters

2013-10-26 Thread Bjoern Hoehrmann
* Claude Pache wrote: You might know that the following ES expressions are broken: text.charAt(0) // get the first character of the text text.length 100 ? text.substring(0,100) + '...' : text // cut the text after 100 characters The reason is *not* because ES works with UTF-16

Re: Object.create() VS functions

2013-10-26 Thread David Bruant
Le 26/10/2013 15:44, Michaël Rouges a écrit : Bonjour à tous, Bonjour, `Knowing that every function is an object, I am surprised that the Object.create() method doesn't really allow cloning function. I don't follow the logic of this sentence. In any case, the purpose of Object.create is to

RE: Object.create() VS functions

2013-10-26 Thread Nathan Wall
Before getting into the exact situation with `Object.create` and functions, the first thing to understand is that `Object.create(proto)` creates an object with prototype of `proto`.  As others have said, this is different from cloning. Here's a simple example which should show the differences

Re: Re: Object.create() VS functions

2013-10-26 Thread Michaël Rouges
Thank you for your answers. Sorry for my misnomer, I meant to copy a function, not to clone a function. In fact, it's been a while I do the technical research around the JavaScript , and this research has led me to realize that there is no feature to simply copy a function (or class) , including

Proposal to simplify Generators impact

2013-10-26 Thread Lucio Tato
It's really needed to make js syntax more complex in order to implement generators? It's function* really needed? can you just expose Generator as a core function? can yield be a function-call-like-construct instead of a new language construction? function fibonacci() { let [prev, curr] = [0,

Re: Proposal to simplify Generators impact

2013-10-26 Thread Rick Waldron
On Sat, Oct 26, 2013 at 1:01 PM, Lucio Tato luciot...@gmail.com wrote: It's really needed to make js syntax more complex in order to implement generators? It's function* really needed? Yes, because `yield` is only reserved in strict mode code, which means this is valid today: function g()

Re: Generic Bundling

2013-10-26 Thread Andrea Giammarchi
Is it possible to not put HTTP in the middle of your thoughts? Why is **non HTTP** bundling a no go? Don't you donwload a single blob to install chrome and then eventually have incremental updates? Why that single blob at the beginning should not be possible only in JS since every other

Re: Generic Bundling

2013-10-26 Thread François REMY
I can’t help but repeat, what you describe is called an app package format. Windows 8 has one, Chrome has one, Firefox OS has one; others may have one, too. There are discussions about a standardized app package format going on, but they are not happening on es-discuss. Why do you think this

Re: Generic Bundling

2013-10-26 Thread Andrea Giammarchi
Apologies, I just answered what Ilya answered but I'd like to see this discussion ... where is this happening? Thanks a lot and send even off thread if you can. On Sat, Oct 26, 2013 at 2:10 PM, François REMY francois.remy@outlook.com wrote: I can’t help but repeat, what you describe is

Re: Generic Bundling

2013-10-26 Thread François REMY
I think it was once discussed at public-weba...@w3.org. → http://www.w3.org/TR/2012/PER-widgets-20120925/#zip-archive At some point there was also a community group but I’m not sure it’s still active; it published some interesting format comparisons: →

Re: Proposal to simplify Generators impact

2013-10-26 Thread Lucio Tato
Rick: I understand. But it is always a trade-off. If the reason to introduce a new construct is because there may already be code that defines a function called `yield`, it seems to me as a bad trade-off. (advantages vs disadvantages) In your example... function yield() {... - will raise a

Re: Proposal to simplify Generators impact

2013-10-26 Thread Axel Rauschmayer
Another reason: you can’t have empty generators without marking them in some manner. On Sat, Oct 26, 2013 at 1:01 PM, Lucio Tato luciot...@gmail.com wrote: It's really needed to make js syntax more complex in order to implement generators? It's function* really needed? -- Dr. Axel

Re: Proposal to simplify Generators impact

2013-10-26 Thread Till Schneidereit
On Sun, Oct 27, 2013 at 1:59 AM, Lucio Tato luciot...@gmail.com wrote: yield*(curr); Note that, in difference to `function* foo`, that is valid ES5. In fact, I bet there is real code along the lines of `yield*(time - offset)` out there. ___

Re: Proposal to simplify Generators impact

2013-10-26 Thread Brendan Eich
Yup. Look (Licio), we've been over this many times, recorded here in es-discuss (directly in posts and in TC39 meeting notes). We are not adding generator syntax lightly. It is necessary to preserve backward compatibility. /be Till Schneidereit mailto:t...@tillschneidereit.net October 26,

Proposal for new floating point and integer data types

2013-10-26 Thread Brandon Andrews
I've seen posts asking for optional strong typing (often relating to typescript), but not many asking for data types. I think since the process takes a while it would be a good idea to consider adding extra data types on top of the already existing dynamic ones. I'll keep each comment short

Re: Working with grapheme clusters

2013-10-26 Thread Norbert Lindenberg
On Oct 26, 2013, at 5:39 , Bjoern Hoehrmann derhoe...@gmx.net wrote: * Norbert Lindenberg wrote: On Oct 25, 2013, at 18:35 , Jason Orendorff jason.orendo...@gmail.com wrote: UTF-16 is designed so that you can search based on code units alone, without computing boundaries. RegExp searches

Re: Proposal to simplify Generators impact

2013-10-26 Thread Oliver Hunt
On Oct 26, 2013, at 4:59 PM, Lucio Tato luciot...@gmail.com wrote: Rick: I understand. But it is always a trade-off. If the reason to introduce a new construct is because there may already be code that defines a function called `yield`, it seems to me as a bad trade-off. (advantages vs

Re: Working with grapheme clusters

2013-10-26 Thread Norbert Lindenberg
On Oct 26, 2013, at 6:58 , Jason Orendorff jason.orendo...@gmail.com wrote: On Fri, Oct 25, 2013 at 11:42 PM, Norbert Lindenberg ecmascr...@lindenbergsoftware.com wrote: On Oct 25, 2013, at 18:35 , Jason Orendorff jason.orendo...@gmail.com wrote: UTF-16 is designed so that you can

Re: Proposal for new floating point and integer data types

2013-10-26 Thread Rick Waldron
Sorry for the top post, but I recommend reading this: http://wiki.ecmascript.org/doku.php?id=strawman:value_types Rick On Saturday, October 26, 2013, Brandon Andrews wrote: I've seen posts asking for optional strong typing (often relating to typescript), but not many asking for data types. I

RE: Proposal for new floating point and integer data types

2013-10-26 Thread Domenic Denicola
Also http://www.slideshare.net/BrendanEich/js-resp/5, presented in convenient video form at http://www.youtube.com/watch?v=IXIkTrq3Rgg. From: es-discuss [mailto:es-discuss-boun...@mozilla.org] On Behalf Of Rick Waldron Sent: Sunday, October 27, 2013 00:06 To: Brandon Andrews Cc: