[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: #:optional
From: |
Peter Danenberg |
Subject: |
Re: #:optional |
Date: |
Sun, 16 Dec 2007 07:42:55 -0600 |
User-agent: |
Mutt/1.5.16 (2007-06-11) |
On Fri, Dec 14, 2007 at 08:28:14PM -0600, Peter Danenberg wrote:
> #:optional doesn't seem to work in v2.11; has it been replaced with
> something?
Aha, I see that I have to use the define* form; all is well.
By the way, I'm trying to come up with an easy way to make skeletons
of blank measures that match, line for line, any piece I'm working on.
I've come up with the following formulation:
#(use-syntax (ice-9 syncase))
#(define default-rest-value #{ s1 #})
#(define* (empty-measures measures #:optional rest)
(let ((rest-value (if rest rest default-rest-value)))
(ly:export #{ \repeat unfold $measures { $rest-value \noBreak }
\break #})))
#(define-syntax make-tuple
(syntax-rules ()
((_ tuple measures)
(define* (tuple #:optional rest) (empty-measures measures
rest)))))
#(make-tuple single 1)
#(make-tuple double 2)
#(make-tuple triple 3)
#(make-tuple quadruple 4)
#(make-tuple quintuple 5)
#(make-tuple sextuple 6)
#(make-tuple septuple 7)
#(make-tuple octuple 8)
#(make-tuple nontuple 9)
Thing is, it seems decidedly un-Lilypond-like; is there a more elegant
way to go about it?
- #:optional, Peter Danenberg, 2007/12/15
- Re: #:optional,
Peter Danenberg <=