Re: [Vala] interaction of parentheses and string template interpolation via the @ sign



From: Dan Hitt <dan hitt gmail com>

Sent: Friday, 25 December 2015, 19:17
Subject: [Vala] interaction of parentheses and string template interpolation via the @ sign

... 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.  

Multi-line templates work fine:

@"a: $a
b: $b
c:$c"


Parenthess in a template signify an expression, e.g. 

@"$("this evaluates to a string with a $ symbol in it")
$(2 * 42)
$(object_name_with_to_string_method)"



Regards,

Al


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]