lilypond-user
[Top][All Lists]
Advanced

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

Re: Scheme coding: 'number' cases vs 'string' cases


From: Thomas Morley
Subject: Re: Scheme coding: 'number' cases vs 'string' cases
Date: Thu, 9 Apr 2015 18:45:44 +0200

2015-04-09 18:36 GMT+02:00 Pierre Perol-Schneider
<address@hidden>:
> Hi List, hi Schemers,
>
> I'm currently working on finding new tools to ease drawings with the 'path'
> command.
> I already found some nice ones that helped me to create new drawings and
> enhanced old snippets.
> That's what I've done here: http://lsr.di.unimi.it/LSR/Item?id=904
>
> However, I'm not satisfied with the code I'm using there; here's roughly how
> it's working:
>
> \version "2.18.2"
>
> %% hereunder works fine:
> #(define-markup-command (smiley layout props smiley-choice)
>   (number?)
>   (interpret-markup layout props
>     (case smiley-choice
>       ((1)
>         #{
>            \markup "A"
>         #})
>       ((2)
>         #{
>            \markup "smile"
>         #})
>       (else
>         #{
>            \markup
>            \null
>         #})
>       )))
>
> %% Test:
> \markup\column {
>   \smiley #1
>   \smiley #2
>   \smiley #10
> }
>
> %% But I think It would be much better to use:
> #(define-markup-command (smiley-string layout props smiley-choice)
>   (string?)
>   (interpret-markup layout props
>     (case smiley-choice
>       (("A")
>         #{
>            \markup "A"
>         #})
>       ((":)")
>         #{
>            \markup "smile"
>         #})
>       (else
>         #{
>            \markup
>            \null
>         #})
>       )))
>
> %% Test:
> \markup\column {
>   \smiley-string #"A"
>   \smiley-string #":)"
>   \smiley-string #"none"
> }
>
> %%% ... does not work though.
>
> What am I missing?
>
> Thank you in advance,
> Cheers,
> Pierre
>


See this recent thread on -devel
http://lilypond.1069038.n5.nabble.com/banter-style-from-chord-names-jazz-ly-broken-case-problem-td174207.html

Cheers,
  Harm



reply via email to

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