lilypond 2.21 & scheme unbound variable

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

lilypond 2.21 & scheme unbound variable

Gianmaria Lari
The following function has been written by David Kastrup few years ago but it does  not compile on lilypond 2.21

\version "2.21.0"

newFinger =
#(define-event-function (arg) (number-or-markup?)
  #{ -\markup \underline \finger
     #(if (number? arg) (number->string arg) arg)
  #})

The error I get is the following:

error: GUILE signaled an error for the expression beginning here

#

(define-event-function (arg) (number-or-markup?)


Unbound variable: number-or-markup?

Unbound variable: number-or-markup?


How can I fix it?

Thank you, g.

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

Re: lilypond 2.21 & scheme unbound variable

Thomas Morley-2
Am Mo., 1. Apr. 2019 um 23:10 Uhr schrieb Gianmaria Lari
<[hidden email]>:

>
> The following function has been written by David Kastrup few years ago but it does  not compile on lilypond 2.21
>
> \version "2.21.0"
>
> newFinger =
> #(define-event-function (arg) (number-or-markup?)
>   #{ -\markup \underline \finger
>      #(if (number? arg) (number->string arg) arg)
>   #})
>
>
> The error I get is the following:
>
> error: GUILE signaled an error for the expression beginning here
>
> #
>
> (define-event-function (arg) (number-or-markup?)
>
>
> Unbound variable: number-or-markup?
>
> Unbound variable: number-or-markup?
>
>
> How can I fix it?

number-or-markup? was replaced by integer-or-markup?, so use this predicate.

HTH,
  Harm

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

Re: lilypond 2.21 & scheme unbound variable

Aaron Hill
In reply to this post by Gianmaria Lari
On 2019-04-01 2:01 pm, Gianmaria Lari wrote:

> The following function has been written by David Kastrup few years ago
> but
> it does  not compile on lilypond 2.21
>
> \version "2.21.0"
>
> newFinger =
> #(define-event-function (arg) (number-or-markup?)
>   #{ -\markup \underline \finger
>      #(if (number? arg) (number->string arg) arg)
>   #})
>
>
> The error I get is the following:
>
> error: GUILE signaled an error for the expression beginning here
>
> #
>
> (define-event-function (arg) (number-or-markup?)
>
>
> Unbound variable: number-or-markup?
>
> Unbound variable: number-or-markup?
>
>
> How can I fix it?

That's odd.  Granted, I am still on 2.19; but the docs include
number-or-markup? as one of the pre-defined predicates provided by
LilyPond.  Why would it have been removed for 2.21?

%%%%
#(define (number-or-markup? arg)
   (or (number? arg) (markup? arg)))
%%%%

That should replace the function.  But it seems like a bug to me.


-- Aaron Hill

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

Re: lilypond 2.21 & scheme unbound variable

Valentin Villenave-3
In reply to this post by Gianmaria Lari
On 4/1/19, Gianmaria Lari <[hidden email]> wrote:
> How can I fix it?

You just need to first define the number-or-markup? function, which
isn’t included in Scheme or in LilyPond out-of-the-box:

#(define (number-or-markup? x)
   (or (number? x) (markup? x)))

Cheers,
V.

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

Re: lilypond 2.21 & scheme unbound variable

Valentin Villenave-3
On 4/1/19, Valentin Villenave <[hidden email]> wrote:
> You just need to first define the number-or-markup? function, which
> isn’t included in Scheme or in LilyPond out-of-the-box

… Actually, you’d better use integer-or-markup? which _is_ provided,
and which would be more appropriate for fingerings anyway.

Just replace number-or-markup? with integer-or-markup? in your
newFinger definition, and you won’t need anything else.

Cheers,
V.

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

Re: lilypond 2.21 & scheme unbound variable

David Kastrup
In reply to this post by Gianmaria Lari
Gianmaria Lari <[hidden email]> writes:

> The following function has been written by David Kastrup few years ago but
> it does  not compile on lilypond 2.21
>
> \version "2.21.0"
>
> newFinger =
> #(define-event-function (arg) (number-or-markup?)
>   #{ -\markup \underline \finger
>      #(if (number? arg) (number->string arg) arg)
>   #})
>
>
> The error I get is the following:
>
> error: GUILE signaled an error for the expression beginning here
>
> #
>
> (define-event-function (arg) (number-or-markup?)
>
>
> Unbound variable: number-or-markup?
>
> Unbound variable: number-or-markup?
>
>
> How can I fix it?

Use integer-or-markup? instead.

--
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: lilypond 2.21 & scheme unbound variable

Aaron Hill
In reply to this post by Valentin Villenave-3
On 2019-04-01 2:39 pm, Valentin Villenave wrote:
> On 4/1/19, Valentin Villenave <[hidden email]> wrote:
>> You just need to first define the number-or-markup? function, which
>> isn’t included in Scheme or in LilyPond out-of-the-box
>
> … Actually, you’d better use integer-or-markup? which _is_ provided,
> and which would be more appropriate for fingerings anyway.

You mean you don't have fingers numbered e, π, or i?  ;-)

-- Aaron Hill

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

Re: lilypond 2.21 & scheme unbound variable

David Kastrup
In reply to this post by Aaron Hill
Aaron Hill <[hidden email]> writes:

> On 2019-04-01 2:01 pm, Gianmaria Lari wrote:
>> The following function has been written by David Kastrup few years
>> ago but
>> it does  not compile on lilypond 2.21
>>
>> \version "2.21.0"
>>
>> newFinger =
>> #(define-event-function (arg) (number-or-markup?)
>>   #{ -\markup \underline \finger
>>      #(if (number? arg) (number->string arg) arg)
>>   #})
>>
>>
>> The error I get is the following:
>>
>> error: GUILE signaled an error for the expression beginning here
>>
>> #
>>
>> (define-event-function (arg) (number-or-markup?)
>>
>>
>> Unbound variable: number-or-markup?
>>
>> Unbound variable: number-or-markup?
>>
>>
>> How can I fix it?
>
> That's odd.  Granted, I am still on 2.19; but the docs include
> number-or-markup? as one of the pre-defined predicates provided by
> LilyPond.  Why would it have been removed for 2.21?

Because all of its uses would not have been able to deal with a
non-integer sensibly.

This change is not in the stable branch.  Arguably a problem.

--
David Kastrup

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