lilypond-user
[Top][All Lists]
Advanced

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

Re: Wish for short version function


From: David Kastrup
Subject: Re: Wish for short version function
Date: Fri, 10 Jan 2014 10:15:11 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Noeck <address@hidden> writes:

> Hi all,
>
> I have a wish for a scheme function integrated in LilyPond:
> A function that returns the short form of the version used: e.g. 2.18
> (and not 2.18.0)
>
>
> I don’t know if that already exists, I couldn’t find it anywhere. The
> reason why I want this function is below. It would be very easy to
> implement: In scm/lily.scm after the definition of lilypond-version, one
> could add:
>
> (define-safe-public (lilypond-short-version) ; or short-lilypond-version
>   (string-join
>    (map (lambda (x) (if (symbol? x)
>                         (symbol->string x)
>                         (number->string x)))
>         (list-head (ly:version) 2))
>    "."))
>
>
> What for?
> For a custom tagline like: Lilypond 2.18

address@hidden:/usr/local/tmp/lilypond$ lilypond scheme-sandbox
GNU LilyPond 2.19.0
Processing `/usr/local/share/lilypond/2.19.0/ly/scheme-sandbox.ly'
Parsing...
guile> (format "LilyPond ~:@{~a.~a~}" (ly:version))
"LilyPond 2.19"
guile> (exit)

Success: compilation successfully completed
address@hidden:/usr/local/tmp/lilypond$ 

That does not really require a command of its own.

> Why integrated?

You'll likely be writing a format string anyway.

-- 
David Kastrup



reply via email to

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