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

_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to