Re: Multiline Strings

2014-03-08 Thread Florian Bösch
On Fri, Mar 7, 2014 at 8:52 PM, Peter van der Zee e...@qfox.nl wrote: I think you want to take a look at source maps. They're specifically designed to deal with this problem. The problem is that a function like compileShader would look like this: var compileShader(source){ var shader =

Re: Multiline Strings

2014-03-08 Thread John Barton
You may like to take a look at how the traceur compiler ( https://github.com/google/traceur-compiler) works. It allows one to write code like var statement = parseStatement `${result}[${index}++] = ${expression};`; where the ${} syntax surrounds variables from the caller that are substituted

Re: Multiline Strings

2014-03-08 Thread Florian Bösch
On Sat, Mar 8, 2014 at 6:10 PM, John Barton johnjbar...@google.com wrote: You may like to take a look at how the traceur compiler ( https://github.com/google/traceur-compiler) works. It allows one to write code like var statement = parseStatement `${result}[${index}++] = ${expression};`;

Enriched Descriptors, maybe ES7 ?

2014-03-08 Thread Andrea Giammarchi
Yesterday, after my DHTMLConf talk, some developer asked me to present/propose my idea about introducing **optional** types in an ES5 compatible way. Here a quick overview of properties which aim is to guard types or methods signatures, compatible with overloads for both number of arguments, and

Re: Multiline Strings

2014-03-08 Thread Mark S. Miller
On Sat, Mar 8, 2014 at 9:30 AM, Florian Bösch pya...@gmail.com wrote: On Sat, Mar 8, 2014 at 6:10 PM, John Barton johnjbar...@google.comwrote: You may like to take a look at how the traceur compiler ( https://github.com/google/traceur-compiler) works. It allows one to write code like

Re: Multiline Strings

2014-03-08 Thread Mark Miller
On Sat, Mar 8, 2014 at 11:05 AM, Mark S. Miller erig...@google.com wrote: On Sat, Mar 8, 2014 at 9:30 AM, Florian Bösch pya...@gmail.com wrote: On Sat, Mar 8, 2014 at 6:10 PM, John Barton johnjbar...@google.comwrote: You may like to take a look at how the traceur compiler (

Re: Multiline Strings

2014-03-08 Thread Mark Miller
On Sat, Mar 8, 2014 at 11:14 AM, Mark Miller erig...@gmail.com wrote: [...] To see these for yourself in your own browsers, visit http://google-caja.googlecode.com/svn/trunk/src/com/google/caja/ses/explicit.html . and click of the last two [+]s to expand these. -- Cheers, --MarkM

Re: Multiline Strings

2014-03-08 Thread Allen Wirfs-Brock
On Mar 8, 2014, at 11:05 AM, Mark S. Miller wrote: [1] A more correct expansion is: var whatsThis = func( Object.freeze({ raw:Object.freeze(['', ' + ', '\\n = ', '']), cooked: Object.freeze(['', ' + ', '\n = ', '']) }), x, y, x + y );