News for hackers. Stuff that matters.
Re:Lily Programming Language by vorg on Friday July 01, 2016 @07:50PM (#12020542)
> I don't understand why anyone would still require special notation for interpolated strings, when we have the awesome and unambiguous string interpolation syntax introduced by Swift

You're both wrong. String interpolation is just a very thin syntactic layer. It's easy enough to write

  printf("Half of %f is: %f5.2", someVal, someVal * 0.5)
instead of

  print("Half of $someVal is: ${someVal * 0.5}")
and a lot easier for a programming language to parse, without needing to feed the parser into the lexer. And you also get easy formatting of the decimal (e.g. %f5.2), whereas string interpolation (in Swift, Apache Groovy, etc) requires a separate call, e.g.

  print("Half of $someVal is: ${format(someVal * 0.5, "%f5.2")}")
Re:Lily Programming Language by drjeats on Saturday July 02, 2016 @01:16AM (#12021458)
C#'s new interpolation syntax is a counterexample to your point about easy formatting:

https://msdn.microsoft.com/en-us/library/dn961160.aspx#Ancho...

    $"Name = {name}, hours = {hours:hh}"
    var s = $"hello, {name}"
    System.IFormattable s = $"Hello, {name}"
    System.FormattableString s = $"Hello, {name}"
    $"{person.Name, 20} is {person.Age:D3} year {(p.Age == 1 ? "" : "s")} old."