lilypond-devel
[Top][All Lists]
Advanced

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

Re: Add lilypond version predicates/operators (issue 317270043 by addres


From: git
Subject: Re: Add lilypond version predicates/operators (issue 317270043 by address@hidden)
Date: Tue, 14 Feb 2017 08:11:54 -0800


> > However, I found an issue in David's suggestion, namely the
> > (op 0 0) ;; return #t iff op includes equality
> > line.
> > This makes the function return #t when comparing with = and one
list
shortened
> > Try e.g. (ly:version? = 2 16)
> > This returns #t because in the third iteration when the reference
version
has
> > run out of elements it compares 0 to 0.
>
> Have you actually tried it?  If your major version is not actually
2.16, you
> will not even _get_ into a third iteration.

Ok, I take that back.  I admit that the tie-breaker does not work with
strict
equality.  I'll have to think about it.

Yes, my interpretation was wrong (as it's not related to the list
length).

But I've found the solution (I hope)
I need a three-way switch when jumping in the loop:
- Both lists have no further elements: Return current result
- One list has no further elements: Return (op 0 0)
- Both lists have further elements: go into the recursion.

I'll upload a new patch, combining this with Paul's interface suggestion

https://codereview.appspot.com/317270043/



reply via email to

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