groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Theodorou <blackd...@gmx.org>
Subject Re: About raw string and enhanced try-with-resource
Date Thu, 17 May 2018 00:31:26 GMT
On 16.05.2018 23:20, MG wrote:
> 
> 
> On 15.05.2018 10:42, Jochen Theodorou wrote:
> 
>> <zip>I think we really have a big problem with our strings... we have 
>> much too many ways to express them and I think we really have to slim 
>> down here.
>>
> 
> I agree with that - any concrete ideas on what syntax you imagine ? 
> Additional "parameters"/"tag chars" after or before the opening string 
> delimiter... ?

step 1 is to make a list of our string types and define what they are 
for. As well as how much is covered by others. Then we can think of what 
we really need.

Example... let`s say we would want to add tagged templates from 
JavaScript 
(https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)... 
what if we use GStrings instead? What is then still missing from the 
perspective of an IDE for example to make this work. My feeling here is 
for example, that it will not require a syntax change, more a convention 
for the IDEs to ease the recognition of what is inside the string (html, 
sql, json, urls...)

So one obvious difference between our literals and the raw string is the 
interpretation of escaping and interpolation. But if you are really 
thinking about it... if I have /some regexp/, then does it need to be 
interpolated? And considering we then have raw string literals, do we 
need /some regexp/ at all? And then you have to think similar about $/.

Or actually... why do we not make '' and "" multiline? If they are, do 
we really need the tripple variant anymore?

I am not saying they do not have their justification, I just would like 
to have a re-justification of their existence. If we do not find that, 
then we should think about slowly (!) deprecating that syntax.

bye Jochen

Mime
View raw message