lilypond-user
[Top][All Lists]
Advanced

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

Re: Macro pre-processing?


From: Nicolas Sceaux
Subject: Re: Macro pre-processing?
Date: Mon, 01 May 2006 22:37:44 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin)

"Geoff Horton" <address@hidden> writes:

> Mats Bengtsson <address@hidden> writes:

>> As far as I understand, it should be trivial to make a
>> version of define-music-function where the user doesn't have to add
>> these arguments manually, so the syntax is
>>
>> #(new-define-music-function (arg1 arg2 ... ) (typecheck1 typecheck2 ... )
>>   #{    ordinary LilyPond code using $arg1 $arg2 ...  #}
>> }

This is manageable indeed :-)

> I think that would satisfy most of my needs.

???

#(new-define-music-function (arg1 arg2 ... )
                            (typecheck1 typecheck2 ... )
   #{    ordinary LilyPond code using $arg1 $arg2 ...  #})

satisfies your needs but:

#(define-music-function (parser location arg1 arg2 ... )
                        (typecheck1 typecheck2 ... )
   #{    ordinary LilyPond code using $arg1 $arg2 ...  #})

does not? 

Ok so the real problem is the two extra parameters...

#(defmacro-public def-mus-fn ;; short name for short version :)
                 (args typechecks . body)
  (let ((parser (gensym))
        (location (gensym)))
    `(define-music-function (,parser ,location ,@args) ,typechecks
       ,@body)))




reply via email to

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