groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andres Almiray <aalmi...@gmail.com>
Subject Re: [Proposal] GString is implemented eager and treated as normal String since groovy 3.0.0
Date Tue, 11 Sep 2018 10:08:06 GMT
You mean Java.next’s syntax for raw strings as Groovy already has two versions. 

Sent from my primitive Tricorder

> On 11 Sep 2018, at 11:57, Paolo Di Tommaso <paolo.ditommaso@gmail.com> wrote:
> 
> Raw strings would be a great addition to groovy, but as the name implies there shouldn't
be any string interpolation with them. 
> 
> 
> p
> 
>> On Tue, Sep 11, 2018 at 11:49 AM Guillaume Laforge <glaforge@gmail.com> wrote:
>> Yeah, I know.
>> It was more of a joke than a serious suggestion.
>> And indeed, it would make things even more confusing.
>> 
>>> On Tue, Sep 11, 2018 at 11:46 AM Andres Almiray <aalmiray@gmail.com> wrote:
>>> Backquoted strings may become multiline strings in Java.next, akin to our triple
single-quote strings.
>>> Using ` at this time before Java.next releases multiline support would be a problem
for sure.
>>> 
>>> Cheers,
>>> Andres
>>> 
>>> -------------------------------------------
>>> Java Champion; Groovy Enthusiast
>>> JCP EC Associate Seat
>>> http://andresalmiray.com
>>> http://www.linkedin.com/in/aalmiray
>>> --
>>> What goes up, must come down. Ask any system administrator.
>>> There are 10 types of people in the world: Those who understand binary, and those
who don't.
>>> To understand recursion, we must first understand recursion.
>>> 
>>>> On Tue, Sep 11, 2018 at 11:31 AM, Guillaume Laforge <glaforge@gmail.com>
wrote:
>>>> Javascript's  `backquoted ${str}` are immutable.
>>>> So changing the embedded variable str won't change the value of the templated
string.
>>>> As if we didn't have enough variants of strings ;-) perhaps we should support
that one too :-)
>>>> 
>>>>> On Tue, Sep 11, 2018 at 11:20 AM Jochen Theodorou <blackdrag@gmx.org>
wrote:
>>>>> 
>>>>> 
>>>>> Am 11.09.2018 um 01:59 schrieb MG:
>>>>> > Hi Jochen,
>>>>> > 
>>>>> > could you be more precise about where you see the problem(s) in
your 
>>>>> > example:
>>>>> > 
>>>>> > 1) That Wrapper is not an immutable class, and you can therefore
change 
>>>>> > its state after creation ?
>>>>> > 2) That GString $-expressions (outside of "${-> ...}") do not
capture 
>>>>> > the expression, but the result of evaluating the expression (which

>>>>> > oftentimes will be an Object referece) ?
>>>>> > 3) That GString is not immediately evaluated to its String representation
?
>>>>> > 4) ... ?
>>>>> 
>>>>> The problem is user expectations. Many do not expect GString to be 
>>>>> mutable, since they do not use it as a templating solution or something

>>>>> compareable. I think we should offer something here. That does not have

>>>>> to be GString in syntax at all.
>>>>> 
>>>>> Or we align more with Javascript tempalating and make GString immutable.
>>>>> 
>>>>> bye Jochen
>>>> 
>>>> 
>>>> -- 
>>>> Guillaume Laforge
>>>> Apache Groovy committer & PMC Vice-President
>>>> Developer Advocate @ Google Cloud Platform
>>>> 
>>>> Blog: http://glaforge.appspot.com/
>>>> Twitter: @glaforge
>>> 
>> 
>> 
>> -- 
>> Guillaume Laforge
>> Apache Groovy committer & PMC Vice-President
>> Developer Advocate @ Google Cloud Platform
>> 
>> Blog: http://glaforge.appspot.com/
>> Twitter: @glaforge

Mime
View raw message