3 ms·
> I think Groovy's syntax is great, where quotation marks denote an interpolated string, and apostrophes denote a plain old string. That's Perl's syntax, from
by kragen 8y ago
> I think Groovy's syntax is great, where quotation marks denote an interpolated string, and apostrophes denote a plain old string.
That's Perl's syntax, from about 15 years before Groovy, whippersnapper. Off my lawn, now.
- dragonwriter 8y agoYeah, Groovy got it from Ruby which got it from Perl.
- kragen 8y agoYeah, Ruby uses the doublequote/singlequote distinction from Perl, but Ruby tags variables to interpolate with #{}, while Groovy and Perl use $. Oh, although I guess Perl got that syntax from the Bourne shell…
- dragonwriter 8y ago> Yeah, Ruby uses the doublequote/singlequote distinction from Perl, but Ruby tags variables to interpolate with #{}, while Groovy and Perl use $. Huh, I could have sworn that I remembered that Groovy has taken it from Ruby. Incidentally, Ruby uses just # for variables, it uses #{} for arbitrary expressions. A common style prefers #{} even where # alone works, though.
- kragen 8y ago#notallvariables