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 Wright
Subject: Re: Strings as variable names
Date: Sun, 3 Jan 2016 20:19:05 -0600
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun 03 Jan 2016 at 16:22:29 (+0100), David Kastrup wrote:
> 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.

Naturally—this gives you control. One of the difficulties with, for
example, bash's string interpolation ("parameter and variable expansion")
is preventing it happening when you don't want it.

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

Existing strings? I don't understand what you mean. Python's strings
are immutable.

> 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.

That's not my call.

Cheers,
David.



reply via email to

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