lilypond-user
[Top][All Lists]
Advanced

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

Re: "\\[" as music function – stack overflow


From: David Nalesnik
Subject: Re: "\\[" as music function – stack overflow
Date: Sun, 28 Dec 2014 11:31:49 -0600

Hi Simon,

On Sun, Dec 28, 2014 at 9:01 AM, Simon Albrecht <address@hidden> wrote:
Hello,

when I start to compile the attached file, lily takes a long time for parsing and then exits with Microsoft’s "stack overflow/stack exhaustion" error code. I tested this with lily 2.19.8 and .15 and on both Windows and Ubuntu platforms with similar results. How does this come? and how to circumvent it?


I'd assume the reason this happens is because you call [\ within its definition, leading to infinite recursion.

For example, this works:

 
"\\'" =
#(define-music-function (parser location note)
   (ly:music?) #{ \[ $note \melisma #} )
"\\]" = { \melismaEnd }

\score {
  \new Staff { \' c1 d \] e }
  \addlyrics { vi -- de }
}

but this results in a stack overflow:


"\\'" =
#(define-music-function (parser location note)
   (ly:music?) #{ \' $note \melisma #} )
"\\]" = { \melismaEnd }

\score {
  \new Staff { \' c1 d \] e }
  \addlyrics { vi -- de }
}

HTH,
David

reply via email to

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