4 ms·
Scala had it before Swift: http://docs.scala-lang.org/overviews/core/string-interpolation.html http://docs.scala-lang.org/overviews/core/string-interpolati...
by bronxbomber92 12y ago
Scala had it before Swift: http://docs.scala-lang.org/overviews/core/string-interpolation.html http://docs.scala-lang.org/overviews/core/string-interpolati...
(implemented with as a macro AFAIK)
- copsarebastards 12y agoJesus Christ, if you people are going to argue about something as silly as which language had a minor feature first, maybe spend some time learning about programming languages first? Python and Ruby have had equally sophisticated string interpolation since before Scala existed. Perl has had similar string interpolation features for at least 20 years. And it wouldn't surprise me if lisp did it before Perl.
- klibertp 12y agoYou were downvoted - it seems - just because. Or maybe someone felt offended by your mention of a fictional character. Whatever. More to the point: feature known as string interpolation is really, really old. And popular. Just go here: http://rosettacode.org/wiki/String_interpolation_%28included%29 http://rosettacode.org/wiki/String_interpolation_%28included... and see for yourself. TCL is from 1988, for example, which predates Scala quite a bit. Oh, and also predates Swift. Yeah, I'd like people who comment on language features to study PL design history a tiny little bit more.
- copsarebastards 12y agoIgnorance doesn't annoy me--if anything, it's exciting, because there's so much people can learn. What annoys me is that people buy into so much hype around languages that are mediocre at best.
- jkrems 12y agoMy example was from shell string interpolation/`sh`, which predates TCL by more than a decade. Not sure where your "I'd like people to study PL design history" comes from. It sounds kind of pretentious tbh. We were looking for popular languages that use a syntax similar to `\{x}` for string interpolation. TCL uses a dollar sign, so pretty much as far from the C# syntax as possible (inside of the limited syntactical range out there). At least this page does not list any language that uses the same syntax: http://rosettacode.org/wiki/String_interpolation_%28included%29 http://rosettacode.org/wiki/String_interpolation_%28included.... But maybe your vast knowledge of PL design history can provide information on one that does?
- jkrems 12y agoThe actual "discussion" was not about who invented string interpolation (I was talking about shell/`sh` string interpolation btw. which predates Python, Perl, and Ruby). It was about who they "copied" the syntax from since using a backslash as opposed to a dollar or a hash sign isn't quite as common. And none of the languages, including Scala, mentioned here uses that exact syntax. It's just an attempt to trace back syntax decisions to where the authors of the language might have seen it. Fun and games - lighten up. ;)