Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 366137

Summary: [Template Expression] Allow alternative to french quotes
Product: [Tools] Xtend Reporter: jlist9
Component: CoreAssignee: Project Inbox <xtend-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: evermind, fedorychak, juanjoaguililla, moritz.eysholdt, sebastian.zarnekow, sjmaple, sven.efftinge
Version: 2.2.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description jlist9 CLA 2011-12-09 01:32:50 EST
Suggest to use an easier to type character for templates to replace french quotes. Or to allow user-defined character.
Comment 1 Sven Efftinge CLA 2011-12-09 02:46:38 EST
We can of course only think about an alternative, since changing the character would break existing code.
Comment 2 jlist9 CLA 2011-12-09 02:49:29 EST
It might still be a good time to change considering the language is still new and may not have been used much in production yet :)
Comment 3 Juanjo Aguililla CLA 2012-08-07 16:02:56 EDT
For me this is a concern too. I would like to propose the backtick (`) as an alternative.

This character is not commonly used, easier to type than the french quotes, and it is used in unix shell with a similar meaning (replace a command with its output).
Comment 4 Sven Efftinge CLA 2012-08-07 16:22:05 EDT
'''
  `FOR foo : bar`
    `foo.baz`
  `ENDFOR`
'''

not bad.
Comment 5 Sebastian Zarnekow CLA 2012-08-13 05:27:26 EDT
+1
Comment 6 bobby CLA 2012-10-04 04:46:50 EDT
I vote for backtick. No, wait, I vote for anything that is directly typeable on a typical keyboard. 

I like xtend, but looking at this post http://blog.efftinge.de/2011/04/dear-java-killers.html it's hard not to read it this way:

 1. People are reluctant to change. You should leverage existing knowledge where possible. Choosing weird string interpolation characters because you think they look better might be good for your ego but not for the acceptance of your language. Some languages fall into this trap to an extreme. The best example is Xtend which ignores all simple ways of interpolating/substituting strings used in other languages/template engines and suggest to use characters U+00AB and U+00BB which are missing on most keyboards and are platform specific to type.

P. S. Please, also fix the documentation (http://www.eclipse.org/xtend/documentation.html). On macintosh it's not alt+q, alt+Q. It's Option-Backslash and Option-Shift-Backslash. Thank you.
Comment 7 Evermind CLA 2013-04-19 03:18:21 EDT
I support backtick too. And may I ask that what is the decision for this feature, and if backtick is a good candidate, when would it be implemented in Xtend?

I have used Xtend for almost 1 year and I love it very much. Though my teammates are reluctant to adopt or even try it, I had to use it alone in the team. Thanks to capability that Xtend compiles to Java, it has never caused trouble -- they even don't know whether my code is written in Java or Xtend. Xtend frees me of boilerplates and gives me more concise and fluent codewriting expression.

However, recently I had to promise not to use Template Expression feature to be allowed to continue to use Xtend in project. We process a lot of text files encoded in GBK, so our source files are also coding-standardized to be in GBK encoding, otherwise there will be encoding conversion back and forth. GBK is ok for Xtend, except for one thing: FRENCH QUOTEs. They are kind of special and cannot be saved in GBK(and quite a few other encodings I guess). I tried to secretly save Xtend files as UTF-8 encoding, however this shamelessly attempt was discovered quickly. so I have to chose not to use Template Expression anymore, to keep file saveable in GBK encoding, and preserving the rights to use remaining parts of Xtend.

I know this may be a personal expreience, and I'm not complaining about anyone/anything, either my teammates or Xtend. I just want to say that french quotes are incompatible with at least one file encoding in the world(<a href="https://groups.google.com/forum/?fromgroups=#!topic/xtend-lang/NPzYh620dgc">maybe</a> <a href="http://www.eclipse.org/forums/index.php/m/756704/">more</a>, mainly non-western areas I assume) and this may cause trouble sometimes. It is also not so convenient to type, as others have pointed out. 

So personally I would be glad to see this feature request get implemented sooner. I'll wait before that comes true. It will also be good to know the plan or progress too, after all, this feature request has been presented for over 1 year. Anyway, I thank you Xtend authors for your excellent work.
Comment 8 Simon Maple CLA 2015-02-10 06:50:11 EST
I'd really appreciate this. I'd like something like ${x.y} similar to other langs.

I recently learnt you can Ctrl+Space to get this auto generated, but it would still be nice to offer the alternative imo.

Thanks -- Simon