lilypond-devel
[Top][All Lists]
Advanced

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

Re: define-grobs.scm properties not alphabetical


From: Mark Polesky
Subject: Re: define-grobs.scm properties not alphabetical
Date: Thu, 25 Jun 2009 15:51:01 -0700 (PDT)

Here are 2 versions of the same procedure.
Is the second one *too* concise and cryptic?
- Mark

(define (ly:string-compare a b ci)
  (let ((mismatch (first-diff-chars a b ci)))
    (if mismatch
        (if (car mismatch)
            (if (cdr mismatch)
                ((if ci ly:char-ci<? ly:char<?)
                   (car mismatch) (cdr mismatch))
                #f)
            (if (cdr mismatch) #t #f))
      #f)))


(define (ly:string-compare a b ci)
  (let ((mismatch (first-diff-chars a b ci)))
    (cond ((and mismatch (car mismatch) (cdr mismatch))
             ((if ci ly:char-ci<? ly:char<?)
                   (car mismatch) (cdr mismatch)))
          ((and mismatch (cdr mismatch)) #t)
          (else #f))))



      




reply via email to

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