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: Sun, 30 Apr 2006 12:49:12 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin)

"David Feuer" <address@hidden> writes:

> On 4/29/06, Geoff Horton <address@hidden> wrote:
>
>> I question that. I think it looks easy to you because you already know
>> how it all works and fits together.

I'm tired of these kinds of remarks. When someone asks here a specific
question about how to write a function that does that, someone else
answers and explains how to do. At least, when I don't miss theses kinds
of post, I try to answer. Want more examples? look at
ly/music-functions-init.ly where many music functions are defined, some
not more complicated that the one Mats has shown. You can't become
familiar with something if you don't want to practice.

> Agreed.  LilyPond is a domain-specific language.  It is rather odd
> that it is necessary to break out into a different language to do a
> great many things.  It is even odder that LilyPond doesn't use
> Scheme's macro and other capabilities to make even a sub-DSL.

1) Making the LilyPond language a Scheme sub-DSL would require using a
   a lisp-scheme like language for note entry (that's the point of using
   lisp for writing DSLs). Are you really suggesting that? If that's
   the case, nobody prevents you from doing it, just show your mastery
   of syntax-rules. IMHO this is waste of time, for that would be used
   by very few people, if any. Been there, done that.

2) Scheme *is* part of LilyPond language, using #, and scheme "macro and other
   capabilities" are indeed used. what do you think happens when one writes:

pad = #(define-music-function (parser location padding music) (number? 
ly:music?)
        #{ \once \override TextScript #'padding = #$padding
           $music #})

Here you have
 - lilypond syntax
 - scheme inside lilypond syntax
 - lilypond inside scheme inside lilypond syntax
 - scheme inside lilypond inside scheme inside lilypond syntax
The two are very deeply integrated. Live with that.

I don't understand the point of this discussion.

nicolas




reply via email to

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