lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strings as variable names


From: David Kastrup
Subject: Re: Strings as variable names
Date: Sun, 03 Jan 2016 16:22:29 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

David Wright <address@hidden> writes:

> On Mon 28 Dec 2015 at 20:27:22 (+0100), David Kastrup wrote:
>> 
>> The strings in Python's regular expression replacements can interpolate
>> variable values, but those are not part of the string syntax but of the
>> regexp replacement semantics.
>
> Recognising the lack of this construct, python is currently adding string
> interpolation to the language.
>
> https://www.python.org/dev/peps/pep-0498/

Yes and no: you use an f prefix to such strings (for "formatted", in
analogy to the r prefix for "raw" strings) to indicate explicitly you
want to make use of interpolation.

So there is no interpolation for existing strings.  It's essentially a
lexical shorthand for Python's % formatting construct.

At any rate, its place is in the programming language actually used for
string manipulation, so if you want to use something like that in
LilyPond eventually, it makes much more sense asking on the Guile user
and/or developer list than here.

And/or try to work on the Guile 2.0 porting task of course, since
otherwise such changes will not trickle back into LilyPond.

-- 
David Kastrup



reply via email to

[Prev in Thread] Current Thread [Next in Thread]