lilypond-user
[Top][All Lists]
Advanced

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

Re: Metronome mark stem length


From: Andrew Bernard
Subject: Re: Metronome mark stem length
Date: Mon, 17 Apr 2017 22:21:21 +1000

Hi Simon,

It's the signum function sgn of course, implemented in racket as sgn, but not in guile or the SRFI's with guile AFAIK.

You could also say in Scheme:
(define (sgn n)
  (cond ((negative? n) -1)
        ((positive? n)  1)
        (else 0)))
A dozen ways to implement, of course, Would be worth having this function somewhere in the lily libraries.

Andrew



On 17 April 2017 at 21:06, Simon Albrecht <address@hidden> wrote:
Am 16.04.2017 um 19:29 schrieb Thomas Morley:
#(define (sign x)
   (if (= x 0)
       0
       (if (< x 0) -1 1)))

I can hardly imagine that default guile or any SRFI doesn’t already provide such a function – unfortunately I’m not well-versed enough to know… Anyone?


reply via email to

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