lilypond-devel
[Top][All Lists]
Advanced

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

Re: scheme night-mare...


From: Arno Waschk
Subject: Re: scheme night-mare...
Date: Mon, 12 Jul 2010 00:08:02 +0200
User-agent: Opera Mail/10.60 (Linux)

On Sun, 11 Jul 2010 20:08:10 +0200, Neil Puttock <address@hidden> wrote:

On 11 July 2010 15:52, Arno Waschk <address@hidden> wrote:

How do i use this in a c line?

Look up the procedure:

SCM proc = ly_lily_module_constant ("map-alist-keys");

Call the procedure, using scm_call_2:

SCM result = scm_call_2 (proc, arg1, arg2);

Your question isn't really about converting from scheme to c++, it's
really
about getting all of the keys and/or properties from an alist. That's not
built into scheme.

No, it is about easily accessing information buried into some scheme
structures by some little c code.
As long this is not possible, this information is next to encrypted for me.

Why do you need to do this in C/C++ though?

If you're running a .ly file, this information's easily available via
ly:grob-alist-chain:

\relative c' {
  \override Staff.KeySignature #'after-line-breaking =
  #(lambda (grob)
     (for-each (lambda (lst title)
                 (display (format #f "~a:\n" title))
                 (for-each (lambda (entry)
                             (display (format #f " ~a\n" (car entry))))
                           lst)
                  (newline))
      (ly:grob-alist-chain grob '()) '("mutable" "immutable")))
  \key a \major
  a1
}

Cheers,
Neil

Thanks for your explanations!
My main reason for all this is not to do something on the .ly file level (at least not for now) but for learning what is going on on the c++ level, including searching for hints onto my theory that lilypond's processing times grow far more quadratically than i would believe to be necessary (or to prove myself wrong, who knows??

Anyway, i came to a point where it seems very helpful to provide an easy option to print somehow the actual content of e. g. a grob at a certain point in the c++ code, or easily do some other voodoo to it, which i do not know yet... Where dealing with types including the letters S C M proves to be pure horror. Or maybe it is my not-knowledge of those languages? I am musician after all... So i am looking for something fool-proof leading to something easily printable (vulgo: string or the like) and not something hidden within a scheme type labyrinth which i need to translate into a scheme type to call it to have a scheme type result which maybe can or cannot converted into something which might be a scheme type which can be translated into something c++ might be able to convert,.... you got the point....?


But thank you a lot for your help!

Cheers, Arno


--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/



reply via email to

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