Closed forivall closed 8 years ago
the following code
a "a"
could be interpreted as a function call or a tagged template string, since, in javascript, a space can occur between the tag and the template string.
But not in frappe. There, no space is required. This is probably not clear from the README though, since I had no idea that you could put a space there in JavaScript.
Duh, I just thought of an even simpler example
a [i]
is an array / object index / property getter in javascript, but I assume that, likewise, a space there would turn it into a function call.
Correct. Guess there's no need to mention it then.
the following code
could be interpreted as a function call or a tagged template string, since, in javascript, a space can occur between the tag and the template string.
In tacoscript (in which I have implemented parts of, and will be implementing other parts of frappe), only
`` will be used for template tags, and I've completely changed the meaning of
!`, where it can be used for any parentheses-less function calls, so it will be required if the first and only argument is a template literal.The other possible solution would be to require no space between the template tag and the template string: template string:
a"a"
vs function call:a "a"
Semantically, these are the same thing, so, possibly, it just wouldn't matter?