lilypond-user
[Top][All Lists]
Advanced

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

my display function


From: address@hidden
Subject: my display function
Date: Sat, 24 Jan 2015 18:18:21 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

I want to create my own display function that combines several commands into one function.

I have tried this

\version "2.19.15"

#(define bar #f)
#(define tmp #f)

meDisplay =
#(define-void-function (parser location message value)
   (markup? variable?)
   (display message)
   (display " : ")
   (display value)
   (newline)
   )

foo =
#(define-void-function (parser location mus)
   (ly:music?)
     (set! tmp (cons #{ b #} #{ cis #}))
     (meDisplay "tmp" tmp)
     (newline)
     (set! bar (acons 1 tmp bar))
     (display bar)
     (newline)
     (set! tmp (cons #{ cis #} #{ b #}))
     (display tmp)
     (newline)
     (set! bar (acons 2 tmp bar))
     (display bar)
     (newline)
     mus
)

{
  \foo c'
}

But I get this error:
Parsing...c:/users/ame/appdata/local/temp/frescobaldi-a77ofr/tmpe2f6wv/document.ly:19:6: In expression (meTrace "tmp" tmp): c:/users/ame/appdata/local/temp/frescobaldi-a77ofr/tmpe2f6wv/document.ly:19:6: Wrong type to apply: #<Music function #<procedure #f (parser location message value)>>
Exited with return code 1.

I'm probably doing a simple error(?) Like having the wrong type of define-???-function. I have tried a couple of different type of functions but ...

// Anders
--
English isn't my first language.
So any error or strangeness is due to the translation.
Please correct my English so that I may become better.



reply via email to

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