Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-18 Thread dak
https://codereview.appspot.com/317270043/diff/40001/scm/lily-library.scm File scm/lily-library.scm (right): https://codereview.appspot.com/317270043/diff/40001/scm/lily-library.scm#newcode895 scm/lily-library.scm:895: "Lexicographically compare to lists @var{a} and @var{b} using On 2017/02/18 16

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-18 Thread git
https://codereview.appspot.com/317270043/diff/40001/scm/lily-library.scm File scm/lily-library.scm (right): https://codereview.appspot.com/317270043/diff/40001/scm/lily-library.scm#newcode895 scm/lily-library.scm:895: "Lexicographically compare to lists @var{a} and @var{b} using On 2017/02/18 15

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-18 Thread paulwmorris
https://codereview.appspot.com/317270043/diff/40001/scm/lily-library.scm File scm/lily-library.scm (right): https://codereview.appspot.com/317270043/diff/40001/scm/lily-library.scm#newcode895 scm/lily-library.scm:895: "Lexicographically compare to lists @var{a} and @var{b} using I like David's s

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-15 Thread Paul
On 02/14/2017 10:48 AM, d...@gnu.org wrote: It's not a "version-compare" as much as a "lexicographic-compare". Indeed, even better, more multi-purpose. (Now I'm imagining version schemes like Ubuntu's animal names, but nested... Werewolf.Yak.Groundhog) -Paul __

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-14 Thread David Kastrup
thomasmorle...@gmail.com writes: > To throw in my own 2cts. > > Why not compare strings, looks more straight forward to me. > > (define (calculate-version-harm ref-version) > (cond ((string? ref-version) ref-version) > ((number-list? ref-version) > (string-concatenate (list-join

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-14 Thread Urs Liska
Hi Harm, Am 14.02.2017 um 22:03 schrieb thomasmorle...@gmail.com: > To throw in my own 2cts. > > Why not compare strings, looks more straight forward to me. > > Indeed your code looks simpler, and your measurement indicates that the computational cost is very similar. However, David's last comme

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-14 Thread thomasmorley65
On 2017/02/14 21:08:48, thomasmorley651 wrote: > The issue I can imagine: probably more expensive, especially with guilev2 Please disregard the time values from my previous posts, they are adulterated by the problems of _LilyPond_ with guile2 Doing all in pure guile-2.1.6 gives: string-compa

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-14 Thread thomasmorley65
On 2017/02/14 21:03:19, thomasmorley651 wrote: To throw in my own 2cts. Why not compare strings, looks more straight forward to me. (define (calculate-version-harm ref-version) (cond ((string? ref-version) ref-version) ((number-list? ref-version) (string-concatenate (l

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-14 Thread thomasmorley65
To throw in my own 2cts. Why not compare strings, looks more straight forward to me. (define (calculate-version-harm ref-version) (cond ((string? ref-version) ref-version) ((number-list? ref-version) (string-concatenate (list-join (map number->string ref-version) ".")))

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-14 Thread dak
On 2017/02/14 18:20:56, git wrote: Ah yes. I had removed the (and (eq? op =) part, which I shouldn't have done Well, that works only for a very particular equivalence. How about something like #(define (lexicographically op a b) (let* ((ca (car a)) (iseql (op ca ca))) (l

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-14 Thread git
https://codereview.appspot.com/317270043/diff/20001/scm/lily-library.scm File scm/lily-library.scm (right): https://codereview.appspot.com/317270043/diff/20001/scm/lily-library.scm#newcode899 scm/lily-library.scm:899: (let* ((a (car v1)) (b (car v2)) On 2017/02/14 17:29:33, dak wrote: Requires

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-14 Thread dak
https://codereview.appspot.com/317270043/diff/20001/scm/lily-library.scm File scm/lily-library.scm (right): https://codereview.appspot.com/317270043/diff/20001/scm/lily-library.scm#newcode899 scm/lily-library.scm:899: (let* ((a (car v1)) (b (car v2)) Requires v1/v2 to have at least one element.

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-14 Thread dak
On 2017/02/14 15:51:13, dak wrote: On 2017/02/14 15:49:26, dak wrote: > On 2017/02/14 15:46:20, git wrote: > > On 2017/02/14 15:37:35, pwm wrote: > > > On 2017/02/14 15:15:07, git wrote: > > > > I like this more because it's more of a typical procedure invocation. > > > > I think I'll create a

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-14 Thread git
> > 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 w

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-14 Thread dak
On 2017/02/14 15:46:20, git wrote: On 2017/02/14 15:37:35, pwm wrote: > On 2017/02/14 15:15:07, git wrote: > > I like this more because it's more of a typical procedure invocation. > > I think I'll create a new patch with this and a simplified calculate-version > > (that doesn't accept string

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-14 Thread dak
On 2017/02/14 15:49:26, dak wrote: On 2017/02/14 15:46:20, git wrote: > On 2017/02/14 15:37:35, pwm wrote: > > On 2017/02/14 15:15:07, git wrote: > > > I like this more because it's more of a typical procedure invocation. > > > I think I'll create a new patch with this and a simplified calculat

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-14 Thread dak
On 2017/02/14 15:37:35, pwm wrote: On 2017/02/14 15:15:07, git wrote: > I like this more because it's more of a typical procedure invocation. > I think I'll create a new patch with this and a simplified calculate-version > (that doesn't accept string lists) Well, having the procedure as th

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-14 Thread git
On 2017/02/14 15:37:35, pwm wrote: On 2017/02/14 15:15:07, git wrote: > I like this more because it's more of a typical procedure invocation. > I think I'll create a new patch with this and a simplified calculate-version > (that doesn't accept string lists) Well, having the procedure as th

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-14 Thread paulwmorris
On 2017/02/14 15:15:07, git wrote: I like this more because it's more of a typical procedure invocation. I think I'll create a new patch with this and a simplified calculate-version (that doesn't accept string lists) Well, having the procedure as the first argument might be more scheme-ish?

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-14 Thread git
On 2017/02/14 15:00:10, pwm wrote: https://codereview.appspot.com/317270043/diff/1/scm/lily-library.scm File scm/lily-library.scm (right): https://codereview.appspot.com/317270043/diff/1/scm/lily-library.scm#newcode909 scm/lily-library.scm:909: (define-public (lilypond>? ref-version) Instead

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-14 Thread git
Reviewers: dak, pwm, Message: I'm choking a little bit with having the operator as the first argument instead of actually being the first element. But apart from that this solution works very well. And as this is not intended to be end-user facing code it's of course OK to have just one single po

Re: Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-14 Thread paulwmorris
https://codereview.appspot.com/317270043/diff/1/scm/lily-library.scm File scm/lily-library.scm (right): https://codereview.appspot.com/317270043/diff/1/scm/lily-library.scm#newcode909 scm/lily-library.scm:909: (define-public (lilypond>? ref-version) Instead of a separate procedure for each compa

Add lilypond version predicates/operators (issue 317270043 by g...@ursliska.de)

2017-02-14 Thread dak
https://codereview.appspot.com/317270043/diff/1/scm/lily-library.scm File scm/lily-library.scm (right): https://codereview.appspot.com/317270043/diff/1/scm/lily-library.scm#newcode894 scm/lily-library.scm:894: (define (calculate-version ref-version) This seems overly complicated. Why not just s