ly:version? unbound variable

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

ly:version? unbound variable

Stefano Troncaro
Hi everyone! According to this page in the manual the function ly:version? should be implemented, but the example given fails with the error 'unbound variable: ly:version?' which suggests it's not. I'm running it in 2.19.83, was this function deleted and the documentation not updated?

Copying the example here:
#(cond
  ((ly:version? > '(2 20))
   (ly:message "This is code to run for LilyPond after 2.20"))
  ((ly:version? = '(2 19 57))
   (ly:message "This will only be executed with LilyPond 2.19.57"))
  (else (ly:message "This will be executed in any other version")))

Does anyone know what is happening?
Thanks you!

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: ly:version? unbound variable

David Kastrup
Stefano Troncaro <[hidden email]> writes:

> Hi everyone! According to this page in the manual
> <http://lilypond.org/doc/v2.19/Documentation/usage/writing-code-to-support-multiple-versions>
> the function ly:version? should be implemented, but the example given fails
> with the error 'unbound variable: ly:version?' which suggests it's not. I'm
> running it in 2.19.83, was this function deleted and the documentation not
> updated?
>
> Copying the example here:
>
> #(cond
>   ((ly:version? > '(2 20))
>    (ly:message "This is code to run for LilyPond after 2.20"))
>   ((ly:version? = '(2 19 57))
>    (ly:message "This will only be executed with LilyPond 2.19.57"))
>   (else (ly:message "This will be executed in any other version")))
>
>
> Does anyone know what is happening?

They were never exported: they are defined using define, not
define-public.  Now _that_ would have been a feature worth a regtest!

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: ly:version? unbound variable

Thomas Morley-2
Am Mi., 1. Mai 2019 um 19:40 Uhr schrieb David Kastrup <[hidden email]>:

>
> Stefano Troncaro <[hidden email]> writes:
>
> > Hi everyone! According to this page in the manual
> > <http://lilypond.org/doc/v2.19/Documentation/usage/writing-code-to-support-multiple-versions>
> > the function ly:version? should be implemented, but the example given fails
> > with the error 'unbound variable: ly:version?' which suggests it's not. I'm
> > running it in 2.19.83, was this function deleted and the documentation not
> > updated?
> >
> > Copying the example here:
> >
> > #(cond
> >   ((ly:version? > '(2 20))
> >    (ly:message "This is code to run for LilyPond after 2.20"))
> >   ((ly:version? = '(2 19 57))
> >    (ly:message "This will only be executed with LilyPond 2.19.57"))
> >   (else (ly:message "This will be executed in any other version")))
> >
> >
> > Does anyone know what is happening?
>
> They were never exported: they are defined using define, not
> define-public.  Now _that_ would have been a feature worth a regtest!
>
> --
> David Kastrup

Entered as
https://sourceforge.net/p/testlilyissues/issues/5517/

For now the relevant code could be copied or brute-force
#(define ly:version? (@@ (lily) ly:version?))

Cheers,
  Harm

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: ly:version? unbound variable

Stefano Troncaro
Thank you for the answers! I'm happy this helped pinpoint a problem, and as a bonus I ended up learning about @@.

El mié., 1 may. 2019 a las 14:50, Thomas Morley (<[hidden email]>) escribió:
Am Mi., 1. Mai 2019 um 19:40 Uhr schrieb David Kastrup <[hidden email]>:
>
> Stefano Troncaro <[hidden email]> writes:
>
> > Hi everyone! According to this page in the manual
> > <http://lilypond.org/doc/v2.19/Documentation/usage/writing-code-to-support-multiple-versions>
> > the function ly:version? should be implemented, but the example given fails
> > with the error 'unbound variable: ly:version?' which suggests it's not. I'm
> > running it in 2.19.83, was this function deleted and the documentation not
> > updated?
> >
> > Copying the example here:
> >
> > #(cond
> >   ((ly:version? > '(2 20))
> >    (ly:message "This is code to run for LilyPond after 2.20"))
> >   ((ly:version? = '(2 19 57))
> >    (ly:message "This will only be executed with LilyPond 2.19.57"))
> >   (else (ly:message "This will be executed in any other version")))
> >
> >
> > Does anyone know what is happening?
>
> They were never exported: they are defined using define, not
> define-public.  Now _that_ would have been a feature worth a regtest!
>
> --
> David Kastrup

Entered as
https://sourceforge.net/p/testlilyissues/issues/5517/

For now the relevant code could be copied or brute-force
#(define ly:version? (@@ (lily) ly:version?))

Cheers,
  Harm

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user