5 ms·
Edi Weitz gave Common Lisp F-strings before F-strings were cool. https://edicl.github.io/cl-interpol/ https://edicl.github.io/cl-interpol/
by numeromancer 4y ago
Edi Weitz gave Common Lisp F-strings before F-strings were cool.
https://edicl.github.io/cl-interpol/ https://edicl.github.io/cl-interpol/
- nerdponx 4y agoI mean, Bourne shell did it first. And Perl, and Ruby, and...
- agumonkey 4y agoGood point, I'm curious how it started
- nerdponx 4y agoThe oral history of string interpolation might make for an interesting Computerphile video!
- agumonkey 4y agoWhat surprises me is that bash is not syntax comfy but on this part they made a very ergonomic addition
- nerdponx 4y agoYou might really enjoy Zsh. It's a lot like the best of Ksh and Bash but better, because it has sensible word splitting behavior (disabled by default!) as well as both sequential and associative arrays. I use it for a lot of scripts.
- rst 4y agoFortran I/O statements specifying a FORMAT are the first example I'm aware of (released 1957), so the basic idea is at least that old.
- Jtsummers 4y agoI think they meant string interpolation, not format. SNOBOL looks like a very early example, not sure it's the earliest. Though the example there looks more like a demonstration of, I guess, automatic concatenation versus what most people think of as interpolation ("foo {bar} baz" or "foo $bar baz" or similar). https://en.wikipedia.org/wiki/String_interpolation#Snobol https://en.wikipedia.org/wiki/String_interpolation#Snobol
- kazinator 4y agoAlso ancient BASICs had something called PRINT USING, where you could give a picture like #.### how you want your number formatted.
- masklinn 4y agoThat’s just a bespoke take on string formatting. The point if the shell style is you get essentially arbitrary code execution.