OK, thanks for the explanation.

dan

On Sat, Dec 26, 2015 at 1:29 AM, Luca Bruno <[email protected]> wrote:
> I believe this is an issue with the lexer. Template strings are parsed at
> syntax level, not parser level, hence it may not support nested parenthesis.
>
> On Fri, Dec 25, 2015 at 8:17 PM, Dan Hitt <[email protected]> wrote:
>>
>> If you do string interpolation via
>>     string s = @"some text $some_variable";
>> it produces a string like
>>     some text 5
>> if 5 were the value of some_variable.
>>
>> But if you put parentheses in, this gets defeated:
>>     @("some text $some_variable")
>> just becomes
>>     some text $some_variable
>> with no interpolation of the value of some_variable into the string.
>>
>> Is this intentional?
>>
>> This is with vala 0.28.1 on ubuntu 15.10.
>>
>> (And of course it is a very tiny issue, if it is an issue at all.  The
>> reason it
>> came up in the first place was i had something more complicated,
>>    @("a: $a\n" +
>>         "b: $b\n" +
>>         "c: $c\n")
>> and i was very surprised that this did not work.  It can be fixed by the
>> slightly lengthier form
>>     @"a: $a\n" +
>>     @"b: $b\n" +
>>     @"c: $c\n"
>> but i do wonder why grouping with parentheses has such a drastic effect.
>> And it also makes me wonder just what @ does and what it sees: clearly
>> it has greater visibility into its surroundings than just some function.)
>>
>> Thanks in advance for any info.
>>
>> dan
>> _______________________________________________
>> vala-list mailing list
>> [email protected]
>> https://mail.gnome.org/mailman/listinfo/vala-list
>
>
>
>
> --
> NixOS Linux
_______________________________________________
vala-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to