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