|
From: | David Nalesnik |
Subject: | Re: Abbreviations |
Date: | Fri, 3 Apr 2015 13:42:10 -0500 |
Yes, aof course.
Am Freitag, 03. April 2015 20:36 CEST, David Nalesnik <address@hidden> schrieb:
> On Fri, Apr 3, 2015 at 1:28 PM, Mattes <address@hidden> wrote:
>
> >
> > Am Freitag, 03. April 2015 20:15 CEST, Urs Liska <address@hidden>
> > schrieb:
> >
> > >
> > >
> > > Am 03.04.2015 um 19:45 schrieb Kevin Barry:
> > > >
> > > > On Fri, Apr 3, 2015 at 2:23 PM, Urs Liska <address@hidden
> > > > <mailto:address@hidden>> wrote:
> > > >
> > > > I'll note that for explaining in a blog post because it seems like
> > > > a good example for demonstrating the relation between Scheme and
> > > > LilyPond variables and the role of symbols.
> > > >
> > > > Maybe it fits into a post I've just started to plan (explaining
> > > > what "#(define-music-function" actually means).
> > > >
> > > >
> > > > I would be very interested to read it. I have figured out over time
> > > > what kind of things tend to work and which things don't (when it comes
> > > > to variables and substitution) but I don't always understand why, for
> > > > example `t = \tuplet' doesn't work, but `#(define t tuplet)' does.
> >
> > Well, think of it like this (slightly oversimplified):
> >
> > 'tuplet' is a lilypond function, '\' will _call_ this function.
> > Let's quickly check that:
> >
> > guile> tuplet
> > #<Music function #<procedure #f (parser location ratio tuplet-span
> > music)>>
> >
> > If you do '#(define t tuplet)' 't' will have the same value as 'tuplet':
> >
> > guile> (define t tuplet)
> > guile> t
> > #<Music function #<procedure #f (parser location ratio tuplet-span
> > music)>>
> >
> > If you write:
> >
> > t = \tuplet
> >
> > 't' would have the value of calling 'tuplet' .
> >
>
> and thus you will get errors because _calling_ tuplet requires arguments
> t = \tuplet 3/2 { c d e } % works just fine
But that will not do what the OP wanted (creating an alias for tuplet).
#(define t tuplet)
is the easiest way to accomplish that.
[Prev in Thread] | Current Thread | [Next in Thread] |