2017-04-17 14:21 GMT+02:00 Andrew Bernard <andrew.bern...@gmail.com>: > Hi Simon, > > It's the signum function sgn of course,
Ofcourse. > implemented in racket as sgn, but > not in guile or the SRFI's with guile AFAIK. Don't know racket, but it's not in 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. It _is_ in lily-library.scm. >From there I copied it. The purpose was to make issue 5122 work, before the patch is released. Thus all needed definitions/procedures have to be present _in_ the ly-file (ofcourse \include from an .ily-file is possible as well). Leading to numerous lines of code. The patch itself changes only 4 lines of code-changes and adds three lines of comments... https://codereview.appspot.com/324780043/diff/20001/scm/define-markup-commands.scm One could argue whether 'sign' should be public, though ... Cheers, Harm _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user