[Swift-devel] Swift input data: @java and string interpolation bug

Justin M Wozniak wozniak at mcs.anl.gov
Mon Sep 26 17:38:39 CDT 2011


On Mon, 26 Sep 2011, Mihael Hategan wrote:

> On Mon, 2011-09-26 at 14:13 -0500, Justin M Wozniak wrote:
>>>
>>>> string v = "hi";
>>>> string u = "{v}";
>>>>
>>>> results in:
>>>>
>>>> Execution failed:
>>>>          Variable not found: v
>>>
>>> The compiler should escape "{" I think.
>>
>> So should we try to repair this or use a different approach? (I imagine
>> users have seen this.)
>>
>
> I think that if we are to properly do this, then the intermediate XML
> should reflect this rather than silently relying on the underlying
> implementation.
>
> Whether we're going to use the same syntax is a different story. But I
> believe that before we do this, we should discuss the following:
> - how are various data types going to be converted to string
> - the exact syntax that we want
> - whether we're going to support format specifiers (for ints and floats)

Oh, I think we should hide the Karajan interpolation from Swift.  I think 
the dataflow from string interpolation could be problematic.  My initial 
suggestion is to replace the generated <variable> elements with another 
element that skips interpolation, if that is in fact where this is coming 
from.  Or we could try to fix the original intended behavior.

-- 
Justin M Wozniak



More information about the Swift-devel mailing list