On 19 September 2014 01:52, Domenic Denicola dome...@domenicdenicola.com
wrote:
ALL of these things can be accomplished with your own custom tag.
Yes, it can be accomplished with the custom tag function. But this is not
the argument, as also a lot of other things from ES6 spec can be
Alexander Kit wrote:
On 19 September 2014 01:52, Domenic Denicola
dome...@domenicdenicola.com mailto:dome...@domenicdenicola.com wrote:
ALL of these things can be accomplished with your own custom tag.
Yes, it can be accomplished with the custom tag function. But this is
not the
This might be beyond the current state of template strings but wouldn't it
be nice if there was a delimiter character we can use to depict the
beginning of each line of a multiline string? A similar solution like Scala
multliline strings but without `stripMargin` method at the end.
For example:
@mozilla.org
Subject: Re: Re: Multiline template strings that don't break indentation
This might be beyond the current state of template strings but wouldn't it be
nice if there was a delimiter character we can use to depict the beginning of
each line of a multiline string? A similar solution like
On 12 Sep 2014 07:40, Sebastian Zartner sebastianzart...@gmail.com
And if someone wants to use his own tag? Would he have to reimplement
dontIndent or String.noIndentation by himself?
What I meant above with tag concatenation would be something like this:
AFAIK a couple of brackets around the
On Fri, Sep 12, 2014 at 7:40 AM, Sebastian Zartner
sebastianzart...@gmail.com wrote:
And if someone wants to use his own tag? Would he have to reimplement
dontIndent or String.noIndentation by himself?
What I meant above with tag concatenation would be something like this:
var a =
And if someone wants to use his own tag? Would he have to reimplement
dontIndent or String.noIndentation by himself?
I implemented exactly what you want (modulo de-indent specifics) here:
https://gist.github.com/zenparsing/5dffde82d9acef19e43c
This should be left in userland for now, I
On 10 September 2014 01:01, Andy Earnshaw andyearns...@gmail.com wrote:
*Git and linting tools usually bark at you if you have trailing white
space anyway*
Template string is a literal, so any of the linter should not complain
about the trailing whitespace inside, if so this should
Kevin Smith wrote:
This should be left in userland for now, I think.
Absolutely. The trick with design, to paraphrase N. Wirth, is leaving
things out.
With the right primitives (tag in front is function call short hand, you
can compose function calls as Salvador showed), the usability is
On Fri, Sep 12, 2014 at 12:35 PM, Brendan Eich bren...@mozilla.org wrote:
With the right primitives (tag in front is function call short hand, you can
compose function calls as Salvador showed), the usability is fine and the
core language avoids creature feep.
Agreed, although I *would* like
Agreed, although I *would* like to see something very similar to
Kevin's implementation added to the standard library
(`String.dedent`?), so that a million authors don't reinvent the
dedent function in multiple slightly-different ways.
Yes - it sounds like it might be a good cowpath to
I would prefer
var a = `This is a template string.`
`Even though each line is indented to keep the`
`code neat and tidy, the white space used to indent`
`is not in the resulting string` keepindentation`;
as a multiple line string,
2014-09-11 13:55 GMT+08:00 Sebastian Zartner
Hi guys.
Notice we are dealing with literals and I would want to keep the strings as
literal as possible so I think this is a syntax issue as the programmatic
solution like regexp substitution is always available.
My proposal:
var s = `This is a multiline
string. It keeps literal unless
The tag goes at the front. What's missing from the design that can't be
provided as a standard exported deindent function?
/be
Sebastian Zartner wrote:
var a = `This is a template string.
Even though each line is indented to keep the
code neat and
On Sep 11, 2014, at 1:05 AM, Brendan Eich wrote:
The tag goes at the front. What's missing from the design that can't be
provided as a standard exported deindent function?
exactly:
var a = dontIndent
`This is a template string.
Even though each line
The tag goes at the front.
I know. I didn't see this functionality as a tag, though, but rather as a
flag for the client. Having this functionality available as a tag has some
consequences. See below.
What's missing from the design that can't be provided as a standard
exported deindent
On 9 September 2014 16:51, Allen Wirfs-Brock al...@wirfs-brock.com wrote:
Well, just for fun
const N = \n; //maybe we could find evocative unicode name.
var a = `This is a template string. ${
N}Even though each line is indented to keep the ${
Hi everyone,
It's great to finally play around with template strings after noticing them
in the latest Firefox nightly. However, I can't help but think we're
repeating mistakes of the past when it comes to multiline strings and code
tidiness.
Back when I had to write PHP code I used to feel sad
would anything like this work already for you ?
```js
function myFunction () {
var a = (`This is a template string.
Even though each line is indented to keep the
code neat and tidy, the white space used to indent
is not in the
On 9/9/14, 4:18 AM, Andy Earnshaw wrote:
It could be that I'm the only person who is this fussy and it doesn't
bother anyone else, but I hope that's not the case.
We ran into this with Python multiline strings as well when we were
working on Gecko's binding generator.
We (specifically Jason
Well, just for fun
const N = \n; //maybe we could find evocative unicode name.
var a = `This is a template string. ${
N}Even though each line is indented to keep the ${
N}code neat and tidy, the white space used to indent ${
N}is not
You can create a really flexible dedent function/tag pretty easily:
https://gist.github.com/zenparsing/5dffde82d9acef19e43c
Nice, right?
On Tue, Sep 9, 2014 at 10:51 AM, Allen Wirfs-Brock al...@wirfs-brock.com
wrote:
Well, just for fun
const N = \n; //maybe we could find evocative
I would also hope that the trailing indentions will be cut off from the
template string. We had the case in our template engine, multiline strings
are supported and it behaives as follows:
- first line: contains a non-whitespace character → take the complete
string as is and exit, otherwise:
-
Allen's is pretty clever and I'd be almost tempted to use it ;-)
On Tue, Sep 9, 2014 at 4:44 PM, Kevin Smith zenpars...@gmail.com wrote:
You can create a really flexible dedent function/tag pretty easily:
https://gist.github.com/zenparsing/5dffde82d9acef19e43c
Nice, right?
I wrote a
24 matches
Mail list logo