Pierre,
Following Paul's advice, here's working code (which you probably already
figured out, but just for the record). Note that you must use equal? for
comparisons since it's the only one suited for strings:
%<---------- SNIP ----------
#(define-markup-command (smiley-string layout props smiley-choice)
(string?)
(interpret-markup layout props
(cond
((equal? smiley-choice "A")
#{
\markup "A"
#})
((equal? smiley-choice ":)")
#{
\markup "smile"
#})
(else
#{
\markup
\null
#})
)))
%% Test:
\markup\column {
\smiley-string #"A"
\smiley-string #":)"
\smiley-string #"none"
}
%<---------- SNIP ----------
- Abraham
On Thu, Apr 9, 2015 at 11:40 AM, Paul Morris [via Lilypond] <
[email protected]> wrote:
> Schneidy wrote
> What am I missing?
>
> Hi Pierre,
>
> case doesn't work with strings, so you'd need to use cond instead.
>
> Cheers,
> -Paul
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://lilypond.1069038.n5.nabble.com/Scheme-coding-number-cases-vs-string-cases-tp174287p174294.html
> To start a new topic under User, email [email protected]
> To unsubscribe from Lilypond, click here
> <http://lilypond.1069038.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2&code=dGlzaW1zdC5saWx5cG9uZEBnbWFpbC5jb218Mnw4MzU3Njg3MDU=>
> .
> NAML
> <http://lilypond.1069038.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context:
http://lilypond.1069038.n5.nabble.com/Scheme-coding-number-cases-vs-string-cases-tp174287p174295.html
Sent from the User mailing list archive at Nabble.com._______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user